Repository navigation
Update docs build to deploy from gh-pages branch to docs/ directory with preserved branch history - #5605
Conversation
…ges action Co-authored-by: jrhemstad <[email protected]>
|
my bad @jrhemstad - I marked this PR ready for review by mistake, intending to do that for one of my Copilot PRs. |
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_dir: ./_site | ||
| publish_branch: gh-pages | ||
| force_orphan: true |
There was a problem hiding this comment.
@copilot question: Why is force_orphan used here?
There was a problem hiding this comment.
@copilot why is force_orphan used here
There was a problem hiding this comment.
The force_orphan: true setting creates a clean deployment history by making each commit to the gh-pages branch an orphaned commit (no parent history). This prevents the gh-pages branch from accumulating a long history of documentation builds, keeping it lightweight and focused only on the current documentation state. Without this setting, every documentation deployment would add to the branch history, eventually making it very large with hundreds or thousands of build commits.
|
/ok to test bc925a5 |
|
pre-commit.ci autofix |
|
/ok to test 6d4a1cc |
|
@copilot we want to update this so that docs are put in the |
Co-authored-by: jrhemstad <[email protected]>
Updated the workflow to deploy docs to the |
| publish_dir: ./_site | ||
| publish_branch: gh-pages | ||
| destination_dir: docs | ||
| force_orphan: true |
There was a problem hiding this comment.
@copilot we can't use force_orphan because it will wipe out anything else on the branch and we're going to want to use other subdirs in the future for pr-reviews, multi-versioned docs, etc.
There was a problem hiding this comment.
Removed force_orphan: true to preserve existing content on the gh-pages branch. This will allow for future subdirectories like pr-reviews and multi-versioned docs without wiping out the branch content. (commit: 1ff7c57)
Co-authored-by: jrhemstad <[email protected]>
|
/ok to test 690e189 |
|
fyi, I've already updated the repo settings to deploy from the |
…ith preserved branch history (NVIDIA#5605) * Initial plan * Update docs build to deploy from gh-pages branch instead of GitHub Pages action Co-authored-by: jrhemstad <[email protected]> * [pre-commit.ci] auto code formatting * Update docs deployment to deploy to docs/ directory in gh-pages branch Co-authored-by: jrhemstad <[email protected]> * Remove force_orphan to preserve other directories on gh-pages branch Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jake Hemstad <[email protected]>
This PR updates the documentation build and deployment process to use branch-based deployment instead of the GitHub Pages action, with documentation organized in a
docs/directory while preserving existing branch content for future multi-directory usage.Changes Made
Workflow Updates (
.github/workflows/build-docs.yml)peaceiris/actions-gh-pages@v3build-and-deployjob for efficiencypages: write, id-token: writetocontents: writeto allow pushing to branchesdestination_dir: docsto deploy documentation to thedocs/directory in thegh-pagesbranchforce_orphan: trueto preserve existing content on the gh-pages branch for future multi-directory usageAction Updates (
.github/actions/docs-build/action.yml)actions/configure-pages@v3setup step since we're not using GitHub Pages actionKey Benefits
gh-pagesbranch instead of through GitHub Pages actiondocs/directory for better organizationConfiguration Required
Repository maintainers will need to update the GitHub Pages settings to deploy from the
gh-pagesbranch instead of GitHub Actions. The workflow will automatically create thegh-pagesbranch on the first deployment, with documentation located in thedocs/directory.Technical Details
The deployment now uses the well-established
peaceiris/actions-gh-pages@v3action with the following configuration:_sitedirectory (same as before)GITHUB_TOKENfor authenticationgh-pagesbranch with preserved history (noforce_orphan)docs/directory within thegh-pagesbranchThis change maintains all existing documentation generation logic while switching to a more standard branch-based deployment approach with organized directory structure and preserved branch history.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.