Skip to content

PR Preview: update to exclude pr-previews folder on deploy to GH pages#535

Merged
itsmedavep merged 1 commit intomainfrom
dave_pr_preview_fix
Mar 20, 2026
Merged

PR Preview: update to exclude pr-previews folder on deploy to GH pages#535
itsmedavep merged 1 commit intomainfrom
dave_pr_preview_fix

Conversation

@itsmedavep
Copy link
Copy Markdown
Collaborator

@billhimmelsbach @contolini @anselmbradford

Looking into why the PR preview GH action links work for a while then 404 I think I found the culprit. I do not believe it to be an issue with the PR preview action but a repo GH actions setup issue.

Essentially, the repo has competing GH actions that perform differing tasks. Those being build-and-deploy.yml and pr-preview.yml.

Build and deploy triggers after every push to main and builds the website and deploys it to gh-pages branch. PR preview builds the changes on a PR and then pushes that to a folder on the gh-pages branch after every PR event (it also will remove the preview on close of PR).

The crux of it is that build-and-deploy in the deploy step overwrites the entire gh-pages branch. That GH action triggers on every push to main. Following that logic the solution becomes, don't overwrite the pr-preview folder on the branch (gh-pages) we are deploying to.

Changes

clean-exclude If you need to use clean but you'd like to preserve certain files or folders you can use this option. This should contain each pattern as a single line in a multiline string. with No

How to test this PR

  1. It's hard to test this end 2 end without committing to mainline code and then triggering the actions. Suffice it to say, the fix seems very non invasive so IMO worth giving a shot.

Screenshots

Notes

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-03-20 14:13 UTC

Copy link
Copy Markdown
Collaborator

@flacoman91 flacoman91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's give it a try and revert if it doesnt work

@itsmedavep itsmedavep merged commit 0db01a3 into main Mar 20, 2026
3 checks passed
@itsmedavep itsmedavep deleted the dave_pr_preview_fix branch March 20, 2026 14:13
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.

3 participants