Skip to content

Ask GitHub Pages to build again when a maintenance run changes nothing - #6

Merged
sunmachine merged 1 commit into
mainfrom
maintenance-republish
Nov 5, 2026
Merged

sunmachine merged 1 commit into
mainfrom
maintenance-republish

Conversation

@sunmachine

Copy link
Copy Markdown
Collaborator

Summary

Makes a 🚧 Maintenance run ask GitHub Pages to build again when the branch is already right but Pages failed to publish it.

Intent

GitHub Pages can fail to publish a push to gh-pages: its deploy step times out and the site keeps serving the previous build. Running 🚧 Maintenance again did not help, because the branch was already right. The run reported nothing to do and pushed nothing, so Pages had no reason to build, and a maintainer had to call the API by hand.

Changes

  • ./deploy maintenance. When a run finds nothing to change, it reads the last Pages build. A good build of the branch tip ends the run as before. A build still in progress is waited on. A failed build, or a build of another commit, makes it ask Pages to build again and wait up to 5 minutes. The run fails if that build fails or the wait runs out.
  • .github/workflows/maintenance.yml. The token gets pages: write, which asking for a build needs. Only this workflow changes, so 🚀 Deploy and ⏪ Rollback keep pages: read.
  • README. It tells maintainers to run the workflow again with the same choice if a run fails while waiting for Pages.

Tested in a scratch copy with a stand-in for gh, across five Pages states: a build that had failed and then succeeded, a good build, a build that failed twice, a build in progress, and a good build of an older commit. The real Pages API has not been exercised by this code. ./check passes.

GitHub Pages can fail to publish a push to gh-pages: its deploy step
times out and the site keeps serving the previous build. Running 🚧
Maintenance again did not help, because the branch was already right,
so the run reported nothing to do and pushed nothing, and Pages had no
reason to build.

When ./deploy maintenance finds nothing to change, it now reads the last
Pages build. If that build failed, or is of another commit, it asks
Pages to build the branch again and waits for the result. A build still
in progress is waited on rather than requested again. Asking for a build
needs pages: write, so the workflow's token gets it.
@sunmachine
sunmachine merged commit 499d04f into main Nov 5, 2026
1 check passed
@sunmachine
sunmachine deleted the maintenance-republish branch November 5, 2026 19:39
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