Free App Hosting: Run React Public Folder In Github With Pages


Follow these instructinos to run your React app in github pages.

Assuming already have a React application add gh-pages to your app:

1. $ npm install gh-pages --save-dev

2. In package.json confirm gh-pages dependicies are installed

  "devDependencies": {
    "gh-pages""^3.2.3"


3. Add in package.json a homepage property after the "name" property

"homepage" : "https://edwinaquino.github.io/[NAME_OF_REPOSITORY]",


4. Under scripts add predeploy and deploy commands

  "scripts": {
    "predeploy" : "npm run build",
    "deploy" : "gh-pages -d build",


5. CREATE A BUILD
$ npm run deploy

You should see a "Plublished" Message when successfully completed:

> react-app-with-workflow@0.1.0 deploy
> gh-pages -d build

Published

6. Go to your Github profile settings > Pages

Done