From 6254f7750a63bdc72ff50a7bf199b49a9a8c10db Mon Sep 17 00:00:00 2001 From: Felipe Martin <812088+fmartingr@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:37:17 +0200 Subject: [PATCH] fix(ci): prevent tagging docker image as latest on every push (#882) --- .github/workflows/_buildx.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_buildx.yml b/.github/workflows/_buildx.yml index c5303905..6586d7ba 100644 --- a/.github/workflows/_buildx.yml +++ b/.github/workflows/_buildx.yml @@ -24,13 +24,15 @@ jobs: gzip -d -S binaries/.gz__ -r . chmod 755 binaries/shiori_linux_*/shiori + # Every pull request that goes into master - name: Prepare master push tags if: github.event_name == 'push' && github.ref == 'refs/heads/master' run: | REPO=ghcr.io/${{ github.repository }} TAG=$(git describe --tags) - echo "tag_flags=--tag $REPO:$TAG --tag $REPO:latest" >> $GITHUB_ENV + echo "tag_flags=--tag $REPO:$TAG" >> $GITHUB_ENV + # New tagged version - name: Prepare version push tags if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') run: | @@ -44,6 +46,7 @@ jobs: fi echo "tag_flags=--tag $REPO:$TAG --tag $REPO:$TAG2" >> $GITHUB_ENV + # Every pull request - name: Prepare pull request tags if: github.event_name == 'pull_request' run: |