React on github post
-
Front-End
In this post we gonna see how we can deploy a React.js app using github pages:
- Step1
In the root
git init
git add .
git commit -m "comment"
- create a repository on github and
- copy the commmands
- Step 2
npm install gh-pages --save-dev
- Step 3
Edit file
{
package.json
homepage:https://USERNAME.github.io/REPOSITORYNAME/
// BELOW START SCRIPT
predeploy:npm run build
deploy:gh-pages -d build
}
package.json
- Step 4
Step 1 one more time but add:
git push
- Step 5
npm run deploy
and go to the settings page on github repository
the page will be ready in few minutes