Try โ€‚โ€‰HackMD
YAMLException: end of the stream or a document separator is expected at line 18, column 21: "homepage": "https://barrystone.github.io/ ... ^

title: React App deploy on github-pages
tags: App Hosting

React App deploy on github-pages

https://create-react-app.dev/docs/deployment/#github-pages

(should be public repository!!)

  1. npm i -save gh-pages

  2. Add in (package.json)

    โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹ {
    โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹   "homepage": "https://barrystone.github.io/repos-name",
    
    โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹   "scripts": {
    
    โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹     "predeploy": "npm run build",
    โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹     "deploy": "gh-pages -d build"
    
    โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹   }  
    โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹ }
    
  3. npm run deploy

  4. Go to repos setting, set Source to (gh-pages-branch) in github pages.


Reference Turtorial:

  • The Complete Junior to Senior Web Developer Roadmap (2020)/
    4. React + Redux + Module Bundling/
    26. CWD Deploying Our React App