Skip to content

Commit

Permalink
ci: Fix docker push of latest tag
Browse files Browse the repository at this point in the history
The `latest` tag is meant to track the `main` branch, but I just noticed
it hasn't been pushed out in a while. This is because the conditional
gating the push on the branch being `main` is incorrect.

This patch fixes the problem by using the correct conditional on the
branch name.
  • Loading branch information
albertito committed Apr 21, 2024
1 parent 4fbd6fc commit 7dbde5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
docker tag chasquid index.docker.io/${{ secrets.DOCKER_REGISTRY_USER }}/chasquid:$GITHUB_REF_NAME
docker push index.docker.io/${{ secrets.DOCKER_REGISTRY_USER }}/chasquid:$GITHUB_REF_NAME
- name: Dockerhub tag latest
if: env.HAS_DOCKER && env.GITHUB_REF_NAME == 'main'
if: env.HAS_DOCKER && github.ref_name == 'main'
run: |
docker tag chasquid index.docker.io/${{ secrets.DOCKER_REGISTRY_USER }}/chasquid:latest
docker push index.docker.io/${{ secrets.DOCKER_REGISTRY_USER }}/chasquid:latest
Expand All @@ -96,7 +96,7 @@ jobs:
docker tag chasquid registry.gitlab.com/albertito/chasquid:$GITHUB_REF_NAME
docker push registry.gitlab.com/albertito/chasquid:$GITHUB_REF_NAME
- name: Gitlab tag latest
if: env.HAS_GITLAB && env.GITHUB_REF_NAME == 'main'
if: env.HAS_GITLAB && github.ref_name == 'main'
run: |
docker tag chasquid registry.gitlab.com/albertito/chasquid:latest
docker push registry.gitlab.com/albertito/chasquid:latest

0 comments on commit 7dbde5a

Please sign in to comment.