From 2633026c9af538cb70eba54cd79d9a76b0f6139c Mon Sep 17 00:00:00 2001 From: Gustavo Hidalgo Date: Mon, 1 Apr 2024 18:43:55 -0400 Subject: [PATCH] log in with SP credentials --- .github/workflows/cicd.yml | 12 ++++++------ scripts/ciauthenticate | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) 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