gh-pages
is a npm packge help developers to deploy they app on github-pages
TIPS : this installation should be on home path folder (
cd ~
orcd
)
npm i -g create-react-app
# or
npm install -g create-react-app
npx create-react-app {APP_NAME} --use-npm
cd {APP_NAME}
npm i -D gh-pages
# or
npm install --save-dev gh-pages
add below (if not exist or not standard) to your
package.json
file
{
"homepage": "https://{YOUR_GITHUB_USERNAME}.github.io/{REPOSITORY_NAME}",
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
}
}
npm run deploy