From 7dbde5a6949da1f52b3d89af60de9d1e350c5b69 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Sun, 21 Apr 2024 11:55:49 +0100 Subject: [PATCH] ci: Fix docker push of `latest` tag 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. --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9b12e51..bf8c3c5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 @@ -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