TIL_180713 Deploy on github page

Deploy on github page

  • github support service for static application to show it
  • It makes a ‘gh-pages’ branch to publish
  • If want to keep original source code (before optimizing), need to push to master branch

  1. Build to compress and optimize code for production

    1
    $ yarn build
  2. Add ‘homepage’ field in package.json

    1
    "homepage" : "http://myname.github.io/myapp",
  3. Build again

  4. Add gh-pages

    1
    $ yarn add --dev gh-pages
  5. Add blow script in package.json

    1
    2
    3
    4
    5
    6
    7
    // ...
    "scripts": {
    // ...
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
    }
  6. Deploy it

    1
    $ yarn run deploy
  7. App will be shown at http://myname.github.io/myapp