diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c90f9279eb..0cd8f4f238 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -210,21 +210,41 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 + + ########## ACRs ########## + - name: Login to Azure - PROD Subscription + uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 + with: + creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} + + - name: Login to PROD ACR + run: az acr login -n ${_AZ_REGISTRY%.azurecr.io} + + - name: Login to Azure - CI Subscription + uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 + with: + creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} + + - name: Retrieve github PAT secrets + id: retrieve-secret-pat + uses: bitwarden/gh-actions/get-keyvault-secrets@main + with: + keyvault: "bitwarden-ci" + secrets: "github-pat-bitwarden-devops-bot-repo-scope" - name: Build Docker image uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 with: context: . file: build.Dockerfile - load: true platforms: | linux/amd64, linux/arm/v7, linux/arm64/v8 - # push: false - tags: bitwarden-build:latest - # secrets: | - # "GH_PAT=${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}" + push: false + tags: ${{ env._AZ_REGISTRY }}/build:latest + secrets: | + "GH_PAT=${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}" build-docker: name: Build Docker images @@ -284,11 +304,6 @@ jobs: echo "is_publish_branch=false" >> $GITHUB_ENV fi - - name: Docker Test Step - run: | - docker image ls - exit 1 - ########## Set up Docker ########## - name: Set up QEMU emulators uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 @@ -318,6 +333,12 @@ jobs: secrets: "github-pat-bitwarden-devops-bot-repo-scope" ########## Generate image tag and build Docker image ########## + - name: Docker Test Step + run: | + docker image pull $_AZ_REGISTRY/build:latest + docker image ls + exit 1 + - name: Generate Docker image tag id: tag run: |