How to build on `gh-pages` when push on `main` ?
Closed this issue · 2 comments
https://github.com/rossjrw/pr-preview-action is really convenient to get a quick pull request preview!
I'd like to ask: Is it possible to also build the main GitHub pages site on the gh-pages
branch, when I push a commit to the main
branch?
Currently, I use this action https://github.com/JamesIves/github-pages-deploy-action
But the problem with this approach:
The github-pages-deploy-action
overwrites all files on the gh-pages
branch, and therefore the files created by pr-preview-action
will be overwritten.
Here are the two workflows:
https://github.com/kolibril13/okapi2/tree/main/.github/workflows
Hi @kolibril13, to avoid JamesIves' action overwriting the entire branch, you need to exclude the pr-preview
directory, as documented here: https://github.com/rossjrw/pr-preview-action#ensure-your-main-deployment-is-compatible
Thanks a lot!