Repository navigation
Ask GitHub Pages to build again when a maintenance run changes nothing - #6
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 getspages: write, which asking for a build needs. Only this workflow changes, so 🚀 Deploy and ⏪ Rollback keeppages: read.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../checkpasses.