skills/github-pages

[Feature]

pratikkabade opened this issue · 0 comments

Publish React project to GitHub Pages

In here

Content

  1. Install the gh-pages npm package

    npm install gh-pages --save-dev
    
  2. Add a homepage property to the package.json file

    {
      "name": "my-app",
      "version": "0.1.0",
    + "homepage": "https://userName.github.io/repositoryName",
      "private": true,
  3. Add a predeploy property and a deploy property to the scripts object:

    "scripts": {
    +   "predeploy": "npm run build",
    +   "deploy": "gh-pages -d build",
        "start": "react-scripts start",
        "build": "react-scripts build",
  4. Deploy the React app to GitHub Pages

    npm run deploy