1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

Don't upload images to DockerHub registries that don't exist (#2712)

* Don't upload images to DockerHub registries that don't exist

* Fix linting issue

* Fix conditional
This commit is contained in:
Joseph Flinn 2023-02-16 15:14:39 -08:00 committed by GitHub
parent 0fde17fc0e
commit 133a3f70b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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