Fix the docs deploy job by pushing with GITHUB_TOKEN - #83
Merged
Conversation
The docs deploy job has been failing since 2026-06-16 with "git@github.com: Permission denied (publickey)". The workflow writes the GH_ACTIONS_DEPLOY_KEY secret to ~/.ssh/id_rsa and pushes over SSH, but the matching public key is no longer registered on the repository (the deploy key list is empty), so the push can never authenticate. Drop the SSH key entirely and push over HTTPS using the credentials that actions/checkout already persists for GITHUB_TOKEN, with contents: write granted to the job. This removes the long-lived key as both a maintenance burden and a failure mode. The push still starts the GitHub Pages build, so the published site keeps updating as before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cv7Xn4Q8TSpLjpg9aDpuhi
Granting the deploy job contents: write makes the GITHUB_TOKEN available to every step, including the third-party slug action. Previously the SSH key was written only after the docs were built, so that action never ran alongside a credential that could push. Resolve rlespinasse/github-slug-action from a commit instead of the mutable v4.x tag. The pinned commit is what v4.x currently resolves to (also tagged v4.5.0), so the workflow behaves exactly as it does today. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cv7Xn4Q8TSpLjpg9aDpuhi
k-yoshimi
force-pushed
the
fix-docs-deploy-token
branch
from
August 17, 2026 22:23
a1b5e69 to
b763b7c
Compare
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.
Problem
The
deployworkflow has failed on every run since 2026-06-16 (last success: 2025-12-13), so the published documentation has not been updated since then. Every run fails at the final push:The workflow writes the
GH_ACTIONS_DEPLOY_KEYsecret to~/.ssh/id_rsaand pushes togh-pagesover SSH. The secret is still present, but the repository has no deploy keys registered any more, so the matching public key is gone and the push can never authenticate.Change
Drop the SSH key entirely and push over HTTPS using the credentials that
actions/checkoutalready persists forGITHUB_TOKEN, granting the jobcontents: write.This removes a long-lived credential that has to be rotated by hand and that silently breaks the deploy when it goes missing — exactly what happened here.
Because the job now carries a write-capable token through every step,
rlespinasse/github-slug-actionis pinned to a commit rather than resolved through the mutablev4.xtag. The pinned commit is whatv4.xresolves to today (also taggedv4.5.0), so runtime behaviour is unchanged.Verification
Both the previous and the new workflow were run on the
ghactionsbranch, which the workflow already lists as a deploy target.gh-pagessucceeds and the branch is updated.Pushstep contained no Pages API call at all, exactly one build was created for the pushed commit301cf839, attributed togithub-actions[bot], finishing with statusbuiltand no error after 28.9 s.docs/ghactions/was refreshed.An explicit
POST /pages/buildscall was tried during development and then removed: it raced with the build the push had already started and left a spurious failed-build record.A temporary marker file was used to force a
gh-pagesdiff during one run so that the commit and push path was actually exercised; it has since been removed fromgh-pagesand is not part of this branch.Known scope limits
permissionsis scoped per job in GitHub Actions, not per step, so the push credential is present while the documentation is built. Isolating it properly means splitting build and publish into separate jobs and passing the built docs as an artifact. That restructuring is deliberately left out of this change, whose purpose is to make the deploy authenticate at all, and is reasonable follow-up work.Follow-up (not in this PR)
The
GH_ACTIONS_DEPLOY_KEYsecret is unused after this change and no longer functional. It can be deleted from the repository settings.The two failing
Unitjobs on this branch are unrelated to it: they are the pymatgenStructure.toargument-order problem that exists ondevelopand is fixed by #84. This branch only touches.github/workflows/deploy_docs.yml.🤖 Generated with Claude Code
https://claude.ai/code/session_01Cv7Xn4Q8TSpLjpg9aDpuhi