Skip to content

Commit 0e54355

Browse files
committed
fix(ci): one latest on tag pushes, and never publish from cache
Two review findings. metadata-flavor: an explicit metadata-tags list leaves metadata-action's flavor at `latest=auto`, which appends `latest` again on a tag push. The explicit `type=raw,value=latest` already reproduces the previous `flavor: latest=true` on every event, so `latest=false` turns the implicit one off and exactly one `latest` is emitted. Uses the metadata-flavor input added in netresearch/.github#267. cache: was `!= 'schedule'`, so a push build was cached. Since the nightly rebuilds without cache to pick up `apt upgrade`, a subsequent cached push would restore the pre-upgrade layer chain and overwrite `:latest` / `:master` with a LESS patched image than the nightly had just published. Cache is now limited to pull_request, so every run that publishes rebuilds for real. Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
1 parent 095827d commit 0e54355

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,19 @@ jobs:
4848
type=ref,event=tag
4949
type=ref,event=pr
5050
type=raw,value=latest
51+
# An explicit tag list leaves metadata-action's flavor at `latest=auto`,
52+
# which appends `latest` again on a tag push. The explicit type=raw above
53+
# already reproduces the previous `flavor: latest=true` on every event,
54+
# so turn the implicit one off to emit exactly one `latest`.
55+
metadata-flavor: latest=false
5156
push: ${{ github.event_name != 'pull_request' }}
5257
# Cosign keyless (OIDC) signing, as before. Only runs when push is true.
5358
sign: true
5459
# Container scanning already runs in ci.yml (docker-image-ci ->
5560
# build-container, scan: true); the publish workflow never scanned.
5661
scan: false
57-
# The nightly run exists to pick up a fresh `FROM mariadb` base image and
58-
# the apt upgrade layer. With the GHA layer cache it would restore the
59-
# previous layer chain and rebuild nothing, turning that refresh into a
60-
# no-op — so cache is off for scheduled runs only.
61-
cache: ${{ github.event_name != 'schedule' }}
62+
# Cache only on pull_request. Any run that PUBLISHES must rebuild for
63+
# real: with cache-from a push build restores the layer chain from
64+
# before the nightly's `apt upgrade`, and would overwrite `:latest` /
65+
# `:master` with a LESS patched image than the nightly just published.
66+
cache: ${{ github.event_name == 'pull_request' }}

0 commit comments

Comments
 (0)