Skip to content

Commit

Permalink
test acr task run
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Feb 6, 2024
1 parent 3dd6d6c commit 7a01548
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/pr-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Pull request
on:
pull_request:
branches:
- main

permissions:
id-token: write
contents: read

jobs:
build-deploy:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target:
- name: "dev"
acr-name: "radixdev"
client-id: "1a292b18-2960-49a5-b429-c8a50349b5eb"
subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b"
# - name: "playground"
# acr-name: "radixdev"
# client-id: "1a292b18-2960-49a5-b429-c8a50349b5eb"
# subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b"
#
# - name: "platform"
# acr-name: "radixprod"
# client-id: "d1ee58e8-5896-48d9-a777-5418c3df9a58"
# subscription-id: "ded7ca41-37c8-4085-862f-b11d21ab341a"
#
# - name: "c2"
# acr-name: "radixc2prod"
# client-id: "d1ee58e8-5896-48d9-a777-5418c3df9a58"
# subscription-id: "ded7ca41-37c8-4085-862f-b11d21ab341a"
steps:
- uses: actions/checkout@v3

- uses: azure/login@v1
with:
client-id: ${{matrix.target.client-id}}
tenant-id: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
subscription-id: ${{matrix.target.subscription-id}}

- name: Build image
run: >-
az acr task run
--subscription ${AZURE_SUBSCRIPTION_ID}
--name radix-image-builder-internal
--registry ${ACR_NAME}
--context ${GITHUB_WORKSPACE}
--file ${GITHUB_WORKSPACE}/Dockerfile
--set DOCKER_REGISTRY=${ACR_NAME}
--set BRANCH=${GITHUB_REF_NAME}
--set TAGS="--tag ${image_tag}"
--set DOCKER_FILE_NAME=Dockerfile
--set PUSH="--push"
--set REPOSITORY_NAME=${IMAGE_NAME}
--set CACHE=""
--set CACHE_TO_OPTIONS="--cache-to=type=registry,ref=${ACR_NAME}.azurecr.io/${IMAGE_NAME}:radix-cache-${GITHUB_REF_NAME},mode=max"
env:
AZURE_SUBSCRIPTION_ID: ${{matrix.target.subscription-id}}
ACR_NAME: ${{matrix.target.acr-name}}
image_tag: ${{matrix.target.acr-name}}.azurecr.io/${radix-vulnerability-scanner}:${GITHUB_REF_NAME}-${GITHUB_SHA::8}-$(date +%s)
IMAGE_NAME: radix-vulnerability-scanner

0 comments on commit 7a01548

Please sign in to comment.