ci: fix container tag policy
Some checks failed
Code Quality / Code Quality (Elixir 1.15.7 OTP 26.2) (push) Successful in 1m53s
Docker Build and Publish / docker-build (push) Failing after 25s

- only move `latest` on tagged releases
This commit is contained in:
Schuwi
2025-09-21 10:58:39 +02:00
parent d620a9c620
commit 7ce80b6026

View File

@@ -26,10 +26,14 @@ jobs:
with: with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: | tags: |
# Keep a moving branch tag (e.g., main)
type=ref,event=branch type=ref,event=branch
# Version tag on releases (e.g., v1.2.3)
type=ref,event=tag type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}} # Snapshot tag for commits on the default branch (e.g., snapshot-<hash>)
type=raw,value=snapshot-{{sha}},enable={{is_default_branch}} type=raw,value=snapshot-{{sha}},enable={{is_default_branch}}
# Move "latest" only when building from a tag
type=raw,value=latest,enable={{is_tag}}
- name: Log in to Container Registry - name: Log in to Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v3