mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +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:
parent
0fde17fc0e
commit
133a3f70b9
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user