ci: tag images by semver and point latest at newest release
Build and publish container / build (pull_request) Successful in 1m59s

Replace the raw latest-on-default-branch tag, which moved latest on every
main push, with metadata-action's latest=auto flavor so latest follows the
newest non-prerelease v* release. Add a {{major}} tag alongside the
existing version and major.minor semver tags; branch and SHA tags remain
for traceability of non-release builds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Emma Thorpe
2026-06-11 16:43:33 +01:00
parent 17d10ce1a0
commit d296d88c4c
2 changed files with 13 additions and 5 deletions
+8 -3
View File
@@ -39,13 +39,18 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
# Semantic version tags are produced from pushed v* git tags.
# `latest` follows the newest non-prerelease release via latest=auto.
# Branch and SHA tags are kept for traceability of non-release builds.
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
type=ref,event=pr
type=sha
type=raw,value=latest,enable={{is_default_branch}}
flavor: |
latest=auto
- name: Build and push
uses: docker/build-push-action@v6