diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1baa669f8..366b7632a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -259,13 +259,27 @@ jobs: with: creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }} - - name: Setup DCT + - name: Log into Docker if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/release' - id: setup-dct - uses: bitwarden/gh-actions/setup-docker-trust@a8c384a05a974c05c48374c818b004be221d43ff - with: - azure-creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} - azure-keyvault-name: "bitwarden-prod-kv" + env: + DOCKER_USERNAME: ${{ steps.retrieve-secrets.outputs.docker-username }} + DOCKER_PASSWORD: ${{ steps.retrieve-secrets.outputs.docker-password }} + run: | + if [[ "${{ matrix.docker_repo }}" == "bitwardenqa.azurecr.io" ]]; then + az acr login -n bitwardenqa + else + echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + fi + + - name: Setup Docker Trust + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/release' + env: + DCT_DELEGATION_KEY_ID: "c9bde8ec820701516491e5e03d3a6354e7bd66d05fa3df2b0062f68b116dc59c" + DCT_DELEGATE_KEY: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-key }} + run: | + mkdir -p ~/.docker/trust/private + + echo "$DCT_DELEGATE_KEY" > ~/.docker/trust/private/$DCT_DELEGATION_KEY_ID.key - name: Setup service name id: setup