Tag latest image on release (#162)

* Restrict stable tag to v-prefixed releases

* refactor: rewrite regex for categorizing alpha releases

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Himank Dave <93311724+steadyfall@users.noreply.github.com>

---------

Signed-off-by: Himank Dave <93311724+steadyfall@users.noreply.github.com>
Co-authored-by: Himank Dave <93311724+steadyfall@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Juan José Mata
2025-10-01 19:40:20 +02:00
committed by GitHub
parent 72738789f8
commit ed99a4dcab

View File

@@ -86,9 +86,16 @@ jobs:
if [[ $GITHUB_EVENT_NAME == "schedule" ]]; then
BASE_CONFIG+=$'\n'"type=schedule,pattern=nightly"
BASE_CONFIG+=$'\n'"type=schedule,pattern=nightly-{{date 'ddd'}}"
elif [[ "$GITHUB_REF" == refs/tags/v* ]]; then
BASE_CONFIG="type=semver,pattern={{version}}"
BASE_CONFIG+=$'\n'"type=raw,value=stable"
elif [[ "$GITHUB_REF" == refs/tags/* ]]; then
TAG_NAME="${GITHUB_REF#refs/tags/}"
if [[ "$TAG_NAME" == v* ]]; then
BASE_CONFIG="type=semver,pattern={{version}}"
if [[ "$TAG_NAME" == v*-alpha* ]]; then
BASE_CONFIG+=$'\n'"type=raw,value=latest"
else
BASE_CONFIG+=$'\n'"type=raw,value=stable"
fi
fi
fi
{
echo 'TAGS_SPEC<<EOF'