fix(ci): prevent tagging docker image as latest on every push (#882)

This commit is contained in:
Felipe Martin 2024-04-08 15:37:17 +02:00 committed by GitHub
parent a281543e6f
commit 6254f7750a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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