Skip to content

ci: deploy GitHub Pages from an artifact - #1042

Merged
rekmarks-consensys-1 merged 2 commits into
mainfrom
rekm/fix-gh-pages
Sep 3, 2026
Merged

ci: deploy GitHub Pages from an artifact#1042
rekmarks-consensys-1 merged 2 commits into
mainfrom
rekm/fix-gh-pages

Conversation

@rekmarks-consensys-1

@rekmarks-consensys-1 rekmarks-consensys-1 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Publishing coverage to GitHub Pages has been failing since the org move:

remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/Consensys-Incorporated/ocap-kernel.git/'

PUBLISH_DOCS_TOKEN is a personal access token belonging to an account with no write access to this repository, so the push to gh-pages is rejected. The same run also warned that peaceiris/actions-gh-pages is pinned to a version running on the deprecated node20 runtime.

Reissuing the token would fix the symptom and leave the shape intact: a long-lived credential, held by a bot account, granting write access to the repository so that a job can copy 663 static files into a branch. Deploying through the Pages API instead removes the need for one. The job trades contents: write for pages: write, so it can no longer write to any branch — including main — and there is nothing left to rotate.

Changes

  • Replace peaceiris/actions-gh-pages with actions/upload-pages-artifact and actions/deploy-pages. The artifact is staged under _site/coverage, so the served path, which coverage-report.yml derives from github.repository_owner, is unchanged.
  • Narrow the publish job to pages: write and id-token: write, and widen the publish-coverage caller in main.yml to match. A called workflow's jobs cannot request more than the caller grants.
  • Drop PUBLISH_DOCS_TOKEN and the now-meaningless publish_dir input.

Testing

actionlint passes. The deploy path itself only runs on a push to main, so it cannot be exercised from a pull request; the first merge is the test. Verify afterwards that coverage/coverage-summary.json is served from the Pages URL, and that a subsequent pull request's coverage report shows trend indicators rather than warning that no baseline was found.

This depends on the repository's Pages source being set to GitHub Actions rather than "Deploy from a branch"; that is already done, and the API now reports build_type: workflow. The existing gh-pages branch becomes vestigial and can be deleted once a deployment succeeds.

🤖 Generated with Claude Code

The deploy authenticated as a personal access token on an account with no
write access to this repository, so the push to `gh-pages` was rejected.
Rather than reissue it, publish through the Pages deployment API: the job
trades `contents: write` for `pages: write`, so it can no longer write to
any branch, and there is no long-lived credential to rotate. This also
moves off the deprecated node20 runtime that `peaceiris/actions-gh-pages`
still runs on.

Requires the repository's Pages source to be set to GitHub Actions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@rekmarks-consensys-1
rekmarks-consensys-1 requested a review from a team as a code owner September 3, 2026 23:14
@rekmarks-consensys-1 rekmarks-consensys-1 added the no-changelog Indicates that no changelog updates are required, and that related CI checks should be skipped. label Sep 3, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@rekmarks-consensys-1
rekmarks-consensys-1 added this pull request to the merge queue Sep 3, 2026
@rekmarks-consensys-1
rekmarks-consensys-1 removed this pull request from the merge queue due to a manual request Sep 3, 2026
@rekmarks-consensys-1
rekmarks-consensys-1 added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit 3f2e967 Sep 3, 2026
17 checks passed
@rekmarks-consensys-1
rekmarks-consensys-1 deleted the rekm/fix-gh-pages branch September 3, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that no changelog updates are required, and that related CI checks should be skipped.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants