GitHub Pages deployment fails at deploy-pages@v5 — "Deployment failed, try again later" · community · Discussion #200823

· GitHub

2 min read Original article ↗

I’d like to share my recovery example for the “Deploy from a branch” case.

In my repository, GitHub Pages was configured as:

  • Source: Deploy from a branch
  • Branch: gh-pages
  • Path: /
  • build_type: legacy

A custom workflow that publishes files to the gh-pages branch was still succeeding, but the GitHub-created pages-build-deployment workflow started failing at actions/deploy-pages@v5:

Fetching artifact metadata for "github-pages" in this workflow run
Found 1 artifact(s)
Creating Pages deployment with payload:
...
Created deployment for <sha>, ID: <sha>
Getting Pages deployment status...
Error: Deployment failed, try again later.

The first failure looked like a timeout after about 10 minutes. After that, retries failed much faster, usually within 10-20 seconds.

What fixed it for me was re-applying the existing Pages branch settings via the REST API, then publishing a fresh commit to the configured Pages branch:

gh api -X PUT repos/OWNER/REPO/pages \
  -f build_type=legacy \
  -f 'source[branch]=gh-pages' \
  -f 'source[path]=/'

Then I re-ran my own publishing workflow, which force-pushed a new commit to gh-pages.

After that, the GitHub-created pages-build-deployment workflow succeeded again, and the latest Pages build changed from errored to built.

So for repositories that must keep using “Deploy from a branch”, it may be worth checking whether the saved Pages settings or referenced branch commit are stale or internally inconsistent. Re-applying the same Pages source settings, then pushing a fresh commit to the selected branch, recovered my repository.

I’m not sure about the root cause, but this looks related to the same class of issue where toggling the Pages source in Settings resets some internal Pages state.

full (Japanese): https://nikkie-ftnext.hatenablog.com/entry/github-actions-deploy-pages-error-deployment-failed-try-again-later-202607