Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save delafuentej/adb6130c4f231fb3f75f0db34a8833c4 to your computer and use it in GitHub Desktop.
Save delafuentej/adb6130c4f231fb3f75f0db34a8833c4 to your computer and use it in GitHub Desktop.
This is how to deployment React projects on Github
1- Open package.json file and add a homepage at the top before name
==> "homepage": "https://<USERNAME>.github.io/<PROJECT NAME>",
2- install gh-pages using ==> npm i gh-pages
3- Add pre-deploy and deploy to scripts ==>
"pre-deploy": "npm run build",
"deploy": "gh-pages -d build"
4- type npm run pre-deploy in terminal
5- type npm run deploy in terminal
6- It's Done!:) click on homepage link to see published version of your project!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment