Skip to content

Switch GitHub Pages deployment to gh-pages branch source#6

Open
klp2 wants to merge 1 commit into
mainfrom
kphair/gh-pages-branch-deploy
Open

Switch GitHub Pages deployment to gh-pages branch source#6
klp2 wants to merge 1 commit into
mainfrom
kphair/gh-pages-branch-deploy

Conversation

@klp2
Copy link
Copy Markdown
Contributor

@klp2 klp2 commented May 18, 2026

Summary

  • Replace the workflow-source Pages deploy (configure-pages / upload-pages-artifact / deploy-pages) with peaceiris/actions-gh-pages@v4.1.0 pushing built artifacts to a gh-pages branch.
  • Pair this with a terraform change in mm_website (pages.build_type = "workflow"pages.source = { branch = "gh-pages" }). The workflow-source path was silently no-opping in terraform-provider-github on this org-owned, never-bootstrapped repo, which is why no Pages site has ever existed for ipfeed-draft and every workflow run was failing at configure-pages with Resource not accessible by integration.
  • Tighten triggers and permissions: add branches-ignore: [gh-pages] (so peaceiris's push doesn't re-trigger us), narrow build-job perms to contents: write, drop id-token: write along with the deploy job and github-pages environment.
  • touch _site/.nojekyll so Jekyll processing stays off across deploys (peaceiris replaces branch contents on each run; embedding .nojekyll in _site/ makes it durable).

Sequencing for the rollout

  1. ✅ Empty orphan gh-pages branch already pushed (cd47753) so the terraform apply on the companion mm_website branch will succeed instead of erroring with branch does not exist.
  2. After this PR merges to main, the next push runs the workflow → drafts build → peaceiris replaces gh-pages content with _site/.
  3. https://maxmind.github.io/ipfeed-draft/ should serve the index page and link to the built draft HTML/TXT within ~30s of the deploy step finishing.

Test plan

  • CI on this PR builds the drafts cleanly (publish step is gated on github.event_name == 'push', so it stays skipped).
  • After merge, the workflow run on main shows a successful Publish to gh-pages step.
  • gh-pages branch on the remote receives a new commit from github-actions[bot] containing _site/.
  • https://maxmind.github.io/ipfeed-draft/ returns 200 with the index page and working draft links.

🤖 Generated with Claude Code

Replace the workflow-source deploy (configure-pages, upload-pages-artifact,
deploy-pages) with a single peaceiris/actions-gh-pages step that pushes the
built artifacts to a gh-pages branch. This pairs with a terraform change
that switches pages.build_type = "workflow" to pages.source.branch =
"gh-pages": the workflow source path was silently no-opping in
terraform-provider-github on this org-owned, never-bootstrapped repo, so
no Pages site was ever created and every workflow run failed at
configure-pages with "Resource not accessible by integration".

- Drop the deploy job, id-token: write, and the github-pages environment
- Build job perms: contents: read + pages: write -> contents: write
- Add branches-ignore: [gh-pages] to both push and pull_request triggers
  to avoid the publish-loop
- Add touch _site/.nojekyll so Jekyll stays off after each deploy

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant