Skip to content

feat(ci): add refresh-cache input to rebuild layers without reading cache - #850

Merged
ianpittwood merged 1 commit into
mainfrom
refresh-cache
Oct 21, 2026
Merged

ianpittwood merged 1 commit into
mainfrom
refresh-cache

Conversation

@ianpittwood

Copy link
Copy Markdown
Contributor

Part of #847 (epic #849, eMudhra intermediate CA compromise).

Summary

Adds a refresh-cache boolean input (default false) to bakery-build-native.yml. When it is true, the build-test job runs bakery build --no-cache --cache-registry <reg> --push. BuildKit then ignores cached layers but still exports fresh layers to the registry cache (cache-to, mode=max), so later scheduled and push builds reuse the patched layers instead of the stale apt-get upgrade / ca-certificates layer.

The existing cache input is unchanged. cache: false still drops --cache-registry entirely, which turns off both reads and writes.

bakery-build.yml mirrors the input on its --load build step only. Its push step reuses the local layers and never writes the registry cache.

Why --no-cache still writes the cache

Testing

  • actionlint 1.7.12 and the pre-commit hooks (actionlint, zizmor, check-yaml) pass.
  • Manual dispatch on one image with refresh-cache: true: the logs should show no CACHED steps, the GHCR cache tag should get a new digest, and a follow-up normal build should show the apt-upgrade step CACHED from the new entry.
  • Update the v0 tag after merge.

Downstream follow-up

This needs separate PRs once this one merges and v0 is updated. Add a refresh-cache boolean workflow_dispatch input (default false) and pass it to every shared-workflow call:

on:
  workflow_dispatch:
    inputs:
      refresh-cache:
        description: "Rebuild all layers without reading the build cache, but still write fresh layers to the cache registry"
        type: boolean
        default: false
# ...
    with:
      refresh-cache: ${{ inputs.refresh-cache || false }}

|| false matters: inputs.* is null on schedule and push events.

  • images-connect: production.yml, content.yml
  • images-package-manager: production.yml
  • images-workbench: production.yml, session.yml (both uses: calls)
  • images-specialized wgcw.yml: add the dispatch input and append --no-cache to the --load step only (env var plus bash array, like CACHE_FLAGS). Leave the --push step alone so it reuses the tested local layers. That workflow reads the registry cache but never writes it, so a separate question is what refreshes its cache.

…ache

Adds a refresh-cache boolean input to bakery-build-native.yml that passes
--no-cache to bakery build while keeping --cache-registry, so BuildKit skips
cache reads but still exports fresh layers (cache-to, mode=max) to the cache
registry. Mirrored in bakery-build.yml for the --load build step.

Part of #847
@github-actions

Copy link
Copy Markdown

Test Results

2 460 tests  ±0   2 460 ✅ ±0   9m 27s ⏱️ -39s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit bd8a32b. ± Comparison against base commit 5d27865.

@ianpittwood
ianpittwood marked this pull request as ready for review October 21, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants