I've built my static website (berkeleypse.github.io) using create-react-app. Now I'm trying to host it as a User page (https://berkeleypse.github.io) rather than a project page (https://berkeleypse.github.io/<no-project-here>).
The User Guide and specifically, these instructions require me to "Ensure my project's settings use gh-pages branch".
But because the static website I'm trying to host is a User page and not a project page, I'm required to have it use the master branch.
So my question is -- how can I make this work? Any help is greatly appreciated. Thank you!
You can keep source in another branch, and copy contents of build folder to master branch after every build. I don't think there's anything special you need to do鈥攋ust more manual steps. Maybe you could automate it somehow.
Github pages has the option to use a "docs" folder for the github-pages website. Create-react-app uses a build folder so you just need to rename the build folder to docs. This isn't currently configurable, but you can change your build script in package.json:
"build": "react-scripts build && rm -rf docs && mv build docs"
Following the tip from @gaearon , I have created a _source_ branch and the master is only used to track the build folder.
git checkout source
git worktree add build master
Most helpful comment
You can keep source in another branch, and copy contents of
buildfolder tomasterbranch after every build. I don't think there's anything special you need to do鈥攋ust more manual steps. Maybe you could automate it somehow.