Skip to content

Rebuild every image weekly - #12

Merged
michaelaguiar merged 2 commits into
mainfrom
weekly-rebuild
Oct 21, 2026
Merged

michaelaguiar merged 2 commits into
mainfrom
weekly-rebuild

Conversation

@michaelaguiar

@michaelaguiar michaelaguiar commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Images were only rebuilt when a Dockerfile changed or someone ran the workflow by hand. New php.net patch releases (through the official php and dunglas/frankenphp base images) and Alpine package fixes never reached the tags on their own. #11 moved the CLI images to the official images, so this matters for them too.

Changes to .github/workflows/build-and-push.yml:

  • A weekly schedule trigger, Mondays 10:00 UTC (Monday 3:00 a.m. Arizona time).
  • Build everything on schedule. Each build condition now includes github.event_name == 'schedule' next to inputs.force_build_all. Scheduled runs have no workflow_dispatch inputs and no changed files, so otherwise nothing would build.
  • No layer cache on schedule. no-cache: ${{ github.event_name == 'schedule' }} on every build step. With the cache, an unchanged base image would reuse last week's apk add / install-php-extensions layers and keep old Alpine packages. Scheduled runs still write to the cache for later push builds.
  • Children wait for their parents. The dependent and wordpress-dev build and merge jobs now run only if the job they depend on succeeded. On a scheduled run the commit's -<sha> parent tags already exist from an earlier run, so a failed parent would otherwise leave its children rebuilt on last week's image. This is deliberately conservative: one version's failure also holds back the other versions' children for that run.
  • EOL images skipped on schedule. 7.4, 8.0 and 8.1 (eol: true in the matrix) are on Alpine branches that get no updates, so a weekly rebuild would only re-push identical images.

README: says which images rebuild weekly. The FrankenPHP images stay on their pinned FrankenPHP version: upstream only rebuilds its latest release, so after a new FrankenPHP release, PHP patches there still need FRANKENPHP_VERSION bumped by hand. It also says the rebuild refreshes the current commit's -<sha> tags, so a byte-for-byte fixed image needs a digest pin.

Things to know

  • Cost: each scheduled run builds every image except the EOL CLI images without the cache: the 8.3–8.5 CLI images, the 16 FrankenPHP tags and their arm64 builds. Expect each run to take as long as a full force_build_all run, plus extra time for the empty cache.
  • pecl.php.net: the wordpress images still install extensions from pecl. An outage like 2026-10-21's fails that week's run, and the previous images stay published. Re-run the failed jobs.
  • Overlap with pushes: the workflow's cancel-in-progress concurrency group also covers scheduled runs.
    • A push during a scheduled run cancels it. The push run only rebuilds images whose files changed, so a docs-only push means no image gets that week's refresh. If that happens, run the workflow by hand with force_build_all. Keeping push and scheduled runs in separate groups would let an older scheduled run overwrite a newer push's images, which is worse.
    • A scheduled run starting during a push run cancels the push run, but the scheduled run rebuilds everything anyway.
  • Inactivity: GitHub disables scheduled workflows after 60 days without repository activity, and emails the owner before doing so.

Test plan

  • actionlint (1.7.7): no new findings. The same 21 shellcheck info notes appear on main.
  • 34 build conditions and 4 build steps updated.
  • After merge: trigger one run by hand with force_build_all to confirm a full build still works. The first scheduled run is the following Monday; I'll check that it builds every image without the cache.

Images were only rebuilt when a Dockerfile changed or the workflow was run
by hand, so a new php.net patch release in the official php or
dunglas/frankenphp images, or an Alpine package fix, never reached the
tags on its own.

Add a Monday 10:00 UTC schedule. A scheduled run builds every image (each
build condition now also checks github.event_name == 'schedule', since
workflow_dispatch inputs are empty then) without the layer cache, which
would otherwise keep last week's packages whenever the base image is
unchanged. Every build step pulls its base image. The README notes the
rebuild, including that it refreshes the current commit's -<sha> tags.
On a scheduled run the current commit's -<sha> parent tags already exist
from an earlier run, so the build-contexts pin no longer catches a parent
that failed in this run: the dependent and wordpress-dev images would
rebuild and republish on last week's parent. Run each child and merge job
only when the job it depends on succeeded.

Also skip the EOL 7.4-8.1 cli images on schedule (their Alpine branches
get no updates), drop pull: true (the docker-container builder resolves
base images from the registry anyway), and say in the README and the
workflow comment that frankenphp images stay on their pinned FrankenPHP
version.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 1 (single round)

A reviewer with fresh context checked this PR with code-review at high effort.

Confirmed holds

  • Every step gated on change detection or force inputs now also runs on schedule. The ungated setup steps, merge and child jobs, and the summary job behave correctly.
  • inputs being empty on schedule is harmless.
  • tj-actions/changed-files falls back to the HEAD^ diff on schedule without erroring, and its output doesn't matter then.
  • no-cache doesn't stop build-contexts: docker-image://…-<sha> from resolving.
  • actionlint shows no new findings.

Findings

  • P2: a parent that fails on a scheduled run leaves its children built on a stale parent (fixed in the latest commit). On a scheduled run the commit's -<sha> parent tags already exist from an earlier run, so the build-contexts pin can't catch a parent that failed in this run. The dependent and wordpress-dev build and merge jobs now require the job they depend on to have succeeded.
    • This is deliberately conservative: one version's failure holds back the other versions' children for that run. Tracking it per version would mean passing digests between jobs.
  • P3: the PR body said "Sunday 3:00 a.m. Arizona time" (fixed). It's Monday 3:00 a.m. MST.
  • P3: the docs said FrankenPHP images pick up PHP patch releases (fixed). The images are pinned to a FrankenPHP version, and upstream only rebuilds its latest release. The README and workflow comment now say a new FrankenPHP release needs FRANKENPHP_VERSION bumped by hand.
  • P3: the EOL 7.4–8.1 CLI images would be rebuilt weekly for nothing (fixed). Matrix rows marked eol: true skip the scheduled build, and the README says so.
  • P3: the PR body overstated pull: true (fixed by removing it). The docker-container builder already resolves base images from the registry.
  • P3: a push during a scheduled run cancels it (declined; documented accurately). Putting scheduled runs in their own concurrency group would let an older scheduled run overwrite a newer push's images. The PR body now says a docs-only push skips that week's refresh, and that a force_build_all run by hand recovers it.

@michaelaguiar
michaelaguiar marked this pull request as ready for review October 21, 2026 22:26
@michaelaguiar
michaelaguiar merged commit d4bc6cb into main Oct 21, 2026
2 checks passed
@michaelaguiar
michaelaguiar deleted the weekly-rebuild branch October 21, 2026 22:29
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.

1 participant