Skip to content

Fix PR doc previews being wiped on every main branch push#319

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-documentation-preview-issue
Draft

Fix PR doc previews being wiped on every main branch push#319
Copilot wants to merge 2 commits intomainfrom
copilot/fix-documentation-preview-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 19, 2026

Every push to main force-replaced the entire gh-pages branch with only the freshly built main docs, deleting all pr-*/ preview directories and breaking any preview URLs already posted in PR comments.

Change

  • Added keep_files: true to the Deploy Docs step (main branch deploy) in docs.yml, mirroring what the PR preview deploy step already had
# Before
- name: Deploy Docs
  uses: peaceiris/actions-gh-pages@v3
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: doc/_build/html

# After
- name: Deploy Docs
  uses: peaceiris/actions-gh-pages@v3
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: doc/_build/html
    keep_files: true        # preserves pr-*/ preview dirs on gh-pages

The existing docs-pr-cleanup.yml workflow already handles removal of stale preview directories when PRs are closed, so accumulated pr-*/ dirs are not a concern.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…: true

Co-authored-by: JohnGriffiths <397826+JohnGriffiths@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix non-functional documentation preview in PR comments thread Fix PR doc previews being wiped on every main branch push Mar 19, 2026
Copilot AI requested a review from JohnGriffiths March 19, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants