ci(deploy): move the images' :latest only when a release is promoted (#1716)
Quality / check (push) Successful in 3m47s
deploy / gate (push) Successful in 6m29s
deploy / archied-image (push) Successful in 2m59s
deploy / agent-image (push) Successful in 10s
deploy / dist-zip (push) Skipped

This commit is contained in:
sam committed 2026-10-31 21:48:10 +11:00
1 parent a4a7c96da6
commit 2181b5fd08
8 files changed
+100 -46

No files matched your search

+3 -2
View File
@@ -36,7 +36,7 @@ jobs:
- name: Build archied
run: go build -o "$RUNNER_TEMP/archied" ./cmd/archied
# Promotion retags stable in the registry.
# Promotion retags stable and the images' latest in the registry.
- name: Log in to the Gitea registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
@@ -44,4 +44,5 @@ jobs:
env:
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
run: |
"$RUNNER_TEMP/archied" release canary check -dashboard "${{ vars.CANARY_URL }}"
"$RUNNER_TEMP/archied" release canary check -dashboard "${{ vars.CANARY_URL }}" \
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
+8 -9
View File
@@ -138,7 +138,7 @@ jobs:
exit 1
fi
if ! git tag --points-at HEAD | grep -qE '^v[0-9]' ; then
echo "This commit is not a release, so the images are published as :edge and sha-<sha>; :latest keeps naming the newest release."
echo "This commit is not a release, so the images are published as :edge and sha-<sha>; :latest keeps naming the newest promoted release."
fi
archied-image:
@@ -185,19 +185,18 @@ jobs:
echo "release_tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT"
echo "gateway=$GATEWAY_VERSION" >> "$GITHUB_OUTPUT"
echo "runtime=$RUNTIME_VERSION" >> "$GITHUB_OUTPUT"
# :latest names the newest RELEASE, so only a commit that IS one
# publishes it. A push to main publishes :edge (mutable, newest main)
# and sha-<sha> (immutable) instead. That is what stops a release's
# :latest stamping from being overwritten minutes later by the next
# ordinary commit, which left a host reporting dev and made the update
# path unable to tell current from stale (archie-core-i5nb).
# :latest names the newest PROMOTED release, so a release publishes
# :v<version> and canary promotion moves :latest to it. A push to
# main publishes :edge (mutable, newest main) and sha-<sha>
# (immutable), so an ordinary commit never overwrites a release's
# stamping.
#
# `if` blocks rather than `[ -n "$X" ] && echo`: the latter returns
# non-zero when the test fails, and these steps run under `set -e`.
{
echo "archied_tags<<EOF"
if [ -n "$RELEASE_TAG" ]; then
echo "git.catlow.cloud/sam/archied:latest"
echo "git.catlow.cloud/sam/archied:$RELEASE_TAG"
fi
echo "git.catlow.cloud/sam/archied:edge"
echo "git.catlow.cloud/sam/archied:sha-${{ steps.commit.outputs.sha }}"
@@ -260,7 +259,7 @@ jobs:
file: Dockerfile
push: true
tags: |
git.catlow.cloud/sam/archie-agent:latest
git.catlow.cloud/sam/archie-agent:${{ steps.versions.outputs.release_tag }}
git.catlow.cloud/sam/archie-agent:sha-${{ steps.commit.outputs.sha }}
build-args: |
RUNTIME_VERSION=${{ steps.versions.outputs.runtime }}