docfx: sync from repo-template (gh-pages bootstrap fix)#52
Closed
Chris-Wolfgang wants to merge 2 commits into
Closed
docfx: sync from repo-template (gh-pages bootstrap fix)#52Chris-Wolfgang wants to merge 2 commits into
Chris-Wolfgang wants to merge 2 commits into
Conversation
Sync .github/workflows/docfx.yaml from canonical repo-template to pick up the bootstrap fix from Chris-Wolfgang/repo-template#337. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the DocFX GitHub Actions workflow to correctly bootstrap a first-time gh-pages deployment by initializing a fresh git repo when the remote gh-pages branch does not yet exist, while preserving the existing worktree-based flow when it does.
Changes:
- Detect whether
gh-pagesexists and branch between a worktree-based deploy vs. fresh repo initialization. - When
gh-pagesis missing, initialize$WORK_DIRas a git repo ongh-pagesand add an authenticatedoriginremote so later add/commit/push works. - Adjust cleanup to remove either the worktree or the fresh directory.
Owner
Author
|
Superseded by PR #101 (D8 canonical refresh). The wholesale canonical sync of Closing as no-longer-needed. Branch |
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.
Summary
Sync
.github/workflows/docfx.yamlfromrepo-templateto pick up the gh-pages bootstrap fix from Chris-Wolfgang/repo-template#337.What changed
The "Deploy docs to GitHub Pages" step had a latent bug: when the
gh-pagesbranch did not yet exist on the remote,$WORK_DIRwas created as a plain directory and the subsequentgit add/diff --cached/commit/pushfailed withfatal: not a git repository. The fix initializes the directory as a git repo ongh-pagesand adds the authenticatedoriginremote, so the existing add/commit/push works on a first-ever deploy. Cleanup also branches betweengit worktree remove(worktree path) andRemove-Item(fresh-repo path).If
gh-pagesalready exists in this repo (the common case), this change is a no-op at runtime — the bootstrap branch is only taken on a fresh repo.Test plan
gh-pagesis unaffected