Do a production build of the the React app, either locally or as part of a CI/CI flow as below.
- Yarn
$ yarn build
- NPM
$ npm run build
Note that the homepage
value is read from package.json and React sets NODE_ENV='production'
for you.
This project is setup to automatically build and deploy to the gh-pages
branch on Github. That branch is used to run the GitHub Pages site, managed in repo settings.
Do a push to main
or merge a Pull Request against main
to trigger the CI/CD build.
The build and test steps will always run, for quality control, but the app will only deploy on changes to main
.
See the workflow file to manage this.
After a successful build, you can configure your site to be served on GitHub Pages as follows:
- Go to repo Settings.
- Go to GitHub Pages section.
- Enable the site on
gh-pages
branch theroot
directory. - Wait for your site to build.
- Check the Actions tab on the repo for the status of the build.
- Open the public URL when it is done. e.g. https://MichaelCurrin.github.io/react-quickstart