diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 24cc0097bf..716eec9f69 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -343,12 +343,7 @@ jobs: env: IMAGE_TAG: ${{ steps.tag.outputs.image_tag }} PROJECT_NAME: ${{ steps.setup.outputs.project_name }} - run: | - if [ "${{ env.is_publish_branch }}" == "true" ]; then - echo "tags=bitwardenqa.azurecr.io/${PROJECT_NAME}:${IMAGE_TAG},bitwardenprod.azurecr.io/${PROJECT_NAME}:${IMAGE_TAG},bitwarden/${PROJECT_NAME}:${IMAGE_TAG}" >> $GITHUB_OUTPUT - else - echo "tags=bitwardenqa.azurecr.io/${PROJECT_NAME}:${IMAGE_TAG},bitwardenprod.azurecr.io/${PROJECT_NAME}:${IMAGE_TAG}" >> $GITHUB_OUTPUT - fi + run: echo "tags=bitwardenqa.azurecr.io/${PROJECT_NAME}:${IMAGE_TAG},bitwardenprod.azurecr.io/${PROJECT_NAME}:${IMAGE_TAG}" >> $GITHUB_OUTPUT - name: Get build artifact if: ${{ matrix.dotnet }} @@ -374,6 +369,15 @@ jobs: secrets: | "GH_PAT=${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}" + - name: Push to DockerHub + if: contains(matrix.docker_repos, 'bitwarden') && env.is_publish_branch == 'true' + env: + IMAGE_TAG: ${{ steps.tag.outputs.image_tag }} + run: | + docker tag bitwardenprod.azurecr.io/$PROJECT_NAME:${{ env.IMAGE_TAG }} \ + bitwarden/$PROJECT_NAME:${{ env.IMAGE_TAG }} + docker push bitwarden/$PROJECT_NAME:${{ env.IMAGE_TAG }} + - name: Log out of Docker run: | docker logout