diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 6184ae96..e6a25604 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -20,16 +20,23 @@ jobs: name: Build and push image steps: + - name: Login to Azure + id: azure_login_2 + uses: azure/login@v2 + with: + creds: ${{ secrets.EDAV_STF_SERVICE_PRINCIPAL }} + + - name: Login to ACR + run: az acr login --name ${{ vars.CONTAINER_REGISTRY_NAME }} + - name: Build and push image id: build-push - uses: CDCgov/cfa-actions/twostep-container-build@v1.2.0 + uses: CDCgov/cfa-actions/twostep-container-build@v1.2.1 with: + registry: ${{ vars.CONTAINER_REGISTRY_NAME }}.azurecr.io/ container-file-1: ./Containerfile.dependencies container-file-2: ./Containerfile first-step-cache-key: docker-dependencies-${{ runner.os }}-${{ hashFiles('./Containerfile.dependencies') }} - registry: ${{ vars.CONTAINER_REGISTRY }} - username: ${{ vars.CONTAINER_REGISTRY_USERNAME }} - password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} image: ${{ env.IMAGE_NAME }} build-args-2: | TAG=${{ steps.image.outputs.tag }} diff --git a/.github/workflows/delete-container-tag.yaml b/.github/workflows/delete-container-tag.yaml index 996577d1..4e6ae8fe 100644 --- a/.github/workflows/delete-container-tag.yaml +++ b/.github/workflows/delete-container-tag.yaml @@ -4,7 +4,6 @@ on: delete: env: - REGISTRY: ${{ vars.CONTAINER_REGISTRY }} IMAGE_NAME: pyrenew-hew jobs: @@ -38,11 +37,11 @@ jobs: # Remove the image from the registry az acr repository delete \ --yes \ - --name ${{ env.REGISTRY }} \ + --name ${{ vars.CONTAINER_REGISTRY_NAME }} \ --image ${{ env.IMAGE_NAME }}:${{ steps.image-tag.outputs.tag }} # Remove the dependencies image from the registry az acr repository delete \ --yes \ - --name ${{ env.REGISTRY }} \ + --name ${{ vars.CONTAINER_REGISTRY_NAME }} \ --image ${{ env.IMAGE_NAME }}:dependencies-${{ steps.image-tag.outputs.tag }}