Always update the versioned image tag alongside :latest on container changes
CI / build-and-scan (push) Successful in 37s

This commit is contained in:
Djeex
2026-08-22 14:46:56 +02:00
parent f8e6888d50
commit 20ec627515
+3 -8
View File
@@ -82,17 +82,12 @@ jobs:
fi fi
IMAGE=git.djeex.fr/djeex/adguard-cidre IMAGE=git.djeex.fr/djeex/adguard-cidre
VERSION=$(tr -d '[:space:]' < VERSION)
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.djeex.fr -u Djeex --password-stdin echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.djeex.fr -u Djeex --password-stdin
# Retag the already-built, already-scanned image — never rebuild for publish, # Retag the already-built, already-scanned image — never rebuild for publish,
# so what ships is byte-for-byte what Trivy just scanned. # so what ships is byte-for-byte what Trivy just scanned.
docker tag adguard-cidre:ci "$IMAGE:latest" docker tag adguard-cidre:ci "$IMAGE:latest"
docker tag adguard-cidre:ci "$IMAGE:$VERSION"
docker push "$IMAGE:latest" docker push "$IMAGE:latest"
docker push "$IMAGE:$VERSION"
if echo "$CHANGED" | grep -qE '^VERSION$'; then
VERSION=$(tr -d '[:space:]' < VERSION)
docker tag adguard-cidre:ci "$IMAGE:$VERSION"
docker push "$IMAGE:$VERSION"
else
echo "VERSION unchanged, skipping versioned tag to avoid overwriting an existing release."
fi