Test Deploying a react project on Github Page using the gh-pages package
source: https://www.youtube.com/watch?v=SKXkC4SqtRk
By installing the gh-pages,
gh-pages branch
is created automatically where the page will be created and hosted instantaneously.
- Run
npm run build
- Run
npm install gh-pages
- Add
"deploy": "gh-pages -d build"
to the Script in thepackage.json
- the
build
folder, by ReactJS default, contains files to be deployed on the Github Page
- the
- Add
"homepage": "https://<USERNAME>.github.io/<PROJECT-NAME_LOWERCASE>"
as a new property - Run
npm run deploy
- Access the link provided by Github under
settings > Options > Github Pages
- fatal: A branch named 'gh-pages' already exists.
transitive-bullshit/react-modern-library-boilerplate#15