Deploy React Project in Github

Faisal Ahmed - Nov 15 '22 - - Dev Community

Image description

  • first, create a github repository
  • secondly, push the react project in that repository
  • thirdly, install below package
npm install gh-pages --save-dev
Enter fullscreen mode Exit fullscreen mode
  • fourthly, add below two code on package.json file.
"homepage": "https://webfaisalbd.github.io/deploy-demo",
Enter fullscreen mode Exit fullscreen mode
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
Enter fullscreen mode Exit fullscreen mode
  • fifth, add below code in vs code
npm run deploy
Enter fullscreen mode Exit fullscreen mode

If you add some code,
then push the code in github again,
then, write,
npm run deploy
and get the changed code.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .