skills / github-pages

Create a site or blog from your GitHub repositories with GitHub Pages.
MIT License
705 stars 190 forks source link

[Feature] #9

Closed pratikkabade closed 2 years ago

pratikkabade commented 2 years ago

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