Make sure you have the repository on GitHub.
- Add github Pages as a dev dependency to the project.
npm install gh-pages --save-dev
- Add a "homepage" key to the package.json. The value will be a string, with your GitHub username and project repository in the URL.
"homepage":"http://USERNAME.github.io/REPONAME",
The USERNAME will need to be all lowercase
The REPONAME will need to be all lowercase, you may need to rename your repository
- Add a deploy script to the package.json. Keep the other scripts.
"scripts": {
"deploy": "gh-pages -d build",
}
- Run
npm run build
npm run deploy