diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index e50eac00..02d8039f 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -13,6 +13,12 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Authenticate + env: + CLIENT_ID: ${{ fromJSON(secrets.AZURE_CREDENTIALS).clientId }} + CLIENT_SECRET: ${{ fromJSON(secrets.AZURE_CREDENTIALS).clientSecret }} + run: sudo ./scripts/ciauthenticate + - name: Run cibuild run: ./scripts/cibuild @@ -28,12 +34,6 @@ jobs: ;; esac - - name: Authenticate - env: - CLIENT_ID: ${{ fromJSON(secrets.AZURE_CREDENTIALS).clientId }} - CLIENT_SECRET: ${{ fromJSON(secrets.AZURE_CREDENTIALS).clientSecret }} - run: sudo ./scripts/ciauthenticate - - name: Publish images run: ./scripts/cipublish --acr pcccr --tag ${{steps.get_image_tag.outputs.tag}} diff --git a/scripts/ciauthenticate b/scripts/ciauthenticate index c19970b7..5a4868b2 100755 --- a/scripts/ciauthenticate +++ b/scripts/ciauthenticate @@ -14,5 +14,6 @@ CI authentication for this project. } curl -sL https://aka.ms/InstallAzureCLIDeb | bash -az acr login --name pcccr --username ${CLIENT_ID} --password ${CLIENT_SECRET} +az login --service-principal --username ${CLIENT_ID} --tenant "72f988bf-86f1-41af-91ab-2d7cd011db47" -password ${CLIENT_SECRET} +az acr login --name pcccr docker login pcccr.azurecr.io --username ${CLIENT_ID} --password ${CLIENT_SECRET} \ No newline at end of file