Skip to content

Instantly share code, notes, and snippets.

@itherunder
Forked from vre2h/simple-deploy.md
Created June 28, 2022 15:14
Show Gist options
  • Save itherunder/11ffa752a3fff534bf8100ba22391320 to your computer and use it in GitHub Desktop.
Save itherunder/11ffa752a3fff534bf8100ba22391320 to your computer and use it in GitHub Desktop.
Simple guide for deploying your react app to Github-Pages.
  1. Your package.json file should consist a field homepage:
  "homepage": "https://<github-username>.github.io/<project-repo>"

2.1. Install gh-pages via npm:

  npm i --save-dev gh-pages

2.2. Or yarn:

  yarn add --dev gh-pages

3.1. Add new script to package.json via yarn:

    "predeploy": "yarn run build",
    "deploy": "gh-pages -d build"

3.2. Or npm:

    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment