From a3f17583d7fa3a3787b646f03e3f2a7e9849443e Mon Sep 17 00:00:00 2001 From: Kevin Phair Date: Mon, 18 May 2026 10:58:33 -0400 Subject: [PATCH] Switch GitHub Pages deployment to gh-pages branch source 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) --- .github/workflows/ghpages.yml | 37 ++++++++++------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ghpages.yml b/.github/workflows/ghpages.yml index 9b496ba..e4655ae 100644 --- a/.github/workflows/ghpages.yml +++ b/.github/workflows/ghpages.yml @@ -2,12 +2,16 @@ name: "Update Editor's Copy" on: push: + branches-ignore: + - gh-pages paths-ignore: - README.md - CONTRIBUTING.md - LICENSE.md - .gitignore pull_request: + branches-ignore: + - gh-pages paths-ignore: - README.md - CONTRIBUTING.md @@ -25,8 +29,7 @@ jobs: name: "Build Drafts" runs-on: ubuntu-latest permissions: - contents: read - pages: write + contents: write steps: - name: "Checkout" uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -62,6 +65,7 @@ jobs: run: | mkdir -p _site cp -f draft-*.html draft-*.txt _site/ + touch _site/.nojekyll # Generate a simple index page cat > _site/index.html < @@ -92,30 +96,9 @@ jobs: EOF - - name: "Configure Pages" + - name: "Publish to gh-pages" if: github.event_name == 'push' - uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 + uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 with: - enablement: true - - - name: "Upload Pages Artifact" - if: github.event_name == 'push' - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 - with: - path: _site - - deploy: - name: "Deploy to GitHub Pages" - if: github.event_name == 'push' - needs: build - runs-on: ubuntu-latest - permissions: - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: "Deploy to GitHub Pages" - id: deployment - uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_site