Skip to content

fix: image publishes write the Docker cache only on a default-branch push - #191

Merged
ExtraToast merged 1 commit into
mainfrom
ci/publish-cache-on-default-branch
Oct 21, 2026
Merged

ExtraToast merged 1 commit into
mainfrom
ci/publish-cache-on-default-branch

Conversation

@ExtraToast

Copy link
Copy Markdown
Contributor

Why

#189 stopped pull requests from writing caches, but container-publish and crac-train still wrote theirs on every run. Repositories publish from a tag push, and a cache written under a tag's ref can be restored by no later run: the next release has a different tag, and a run can restore only from its own ref or the default branch.

hindsight shows the cost. It publishes three images per tag, and on 2026-10-21 it held 12.9 GB of cache, over the 10 GB limit. main held 2.7 GB, and v1.0.3, v1.0.4 and v1.1.0 each held about another 2–2.7 GB of the same layers.

What

In both workflows cache-from: type=gha stays, and cache-to is empty unless the run is a push to the default branch. This is the same expression #189 uses.

A tag-only publisher now writes no Docker cache at all. Its builds lose only what they could already use: a re-run of the same tag.

Tests

The rule is held for both workflows in tests/test_caches_save_only_on_default_branch.py. The two new tests failed before the change. The full suite and actionlint pass.

@ExtraToast ExtraToast added type: bug Something is broken or behaving incorrectly. area: tooling Reusable workflows, Gradle, templates, Renovate, and API tooling. labels Oct 21, 2026
@ExtraToast ExtraToast self-assigned this Oct 21, 2026
@ExtraToast
ExtraToast merged commit d8a226f into main Oct 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tooling Reusable workflows, Gradle, templates, Renovate, and API tooling. type: bug Something is broken or behaving incorrectly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant