Skip to content

Publish to GitHub Pages ​

Start with the local-only action. It builds the site in a temporary directory, creates a temporary Git worktree, replaces the content of the publication branch, commits changed output, and removes the worktree. Your current checkout stays on its existing branch.

sh
make doc
make publish_build
make publish_gh
git log --oneline --decorate -1 gh-pages
git push origin gh-pages

The final push is shown separately so you can inspect the result first. When that separation is unnecessary, use make publish_gh-push. It updates the same local branch and runs git push origin gh-pages; it does not force the update or push another branch.

GitHub project sites normally live beneath the repository name. During a GitHub publication action, the publisher derives /repository-name/ from origin. A repository named owner.github.io uses /. If no origin URL is available, the checkout directory name is the fallback. Set base explicitly when the published URL uses another path.

WARNING

publish_gh-push will push to remote. Use publish_gh when the repository's authoritative remote is not GitHub, when GitHub is only a mirror, or when you want to review the publication commit before pushing it.