Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Deploying a React App* to GitHub Pages

npm install gh-pages --save-dev
package.json
//...
"homepage": "http://gitname.github.io/react-gh-pages"
//...
"scripts": {
  //...
  "predeploy": "npm run build",
  "deploy": "gh-pages -d build"
}
git init
git remote add origin https://github.com/gitname/react-gh-pages.git
npm run deploy
git add .
git commit -m "Create a React app and publish it to GitHub Pages"
git push origin master
Source by github.com #
 
PREVIOUS NEXT
Tagged: #Deploying #React #GitHub #Pages
ADD COMMENT
Topic
Name
4+2 =