ci(docker): publish image without leading 'v' in version tag

Strip the leading 'v' from git tags (e.g. v1.1.7 -> 1.1.7)
when pushing Docker images to GHCR.

https://chatgpt.com/share/e/699041b9-8610-8013-8d04-fbef93b10d3c
This commit is contained in:
Kevin Veen-Birkenbach
2026-02-14 10:34:41 +01:00
parent 5bbe78b272
commit 01d1626cf2

View File

@@ -49,7 +49,8 @@ jobs:
IMAGE="ghcr.io/${{ github.repository }}"
if [ "${{ github.event_name }}" = "push" ]; then
TAG="${{ github.ref_name }}" # e.g. v1.1.0
RAW_TAG="${{ github.ref_name }}" # e.g. v1.1.7
TAG="${RAW_TAG#v}" # -> 1.1.7 (only strips leading 'v')
echo "tags=$IMAGE:$TAG,$IMAGE:latest" >> "$GITHUB_OUTPUT"
else
echo "tags=$IMAGE:stable" >> "$GITHUB_OUTPUT"