Last active
July 11, 2020 10:24
-
-
Save vigneshwaran-chandrasekaran/8e336d1bf45ba9d7be01c771becda7d0 to your computer and use it in GitHub Desktop.
deploy react app to github page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
In package.json file create property called "homepage" and add public github page url | |
e.g. "homepage": "https://vigneshwaran-chandrasekaran.github.io/react-router-v5/" | |
then install | |
npm install gh-pages --save | |
then add below scripts in package.json | |
"scripts":{ | |
"predeploy": "npm run build", | |
"deploy": "gh-pages -d build", | |
} | |
then deploy the code using npm run deploy | |
Once you successfully deployed open your GitHub code repository and click on settings | |
tab if you scroll down you can see a GitHub Pages then choose a branch to gh-pages. | |
// https://reactgo.com/deploy-react-app-github-pages/ | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awsome, good information, thanks for sharing