Skip to content

14 Deploy

JP Barbosa edited this page Apr 16, 2021 · 1 revision

Deploy

Set API

code ./.env.production
REACT_APP_API=https://typescript-crud-api.herokuapp.com

Add gh-pages

yarn add gh-pages

Add deploy scripts

code ./package.json
{
  ...
  "homepage": "/typescript-crud",
  "dependencies": {
    ...
  },
  "scripts": {
    ...,
    "predeploy": "yarn run build",
    "deploy": "gh-pages -d build"
  },
  ...
}

Commit

git add .
git commit -m "Deploy"

Rename local branch to main (if necessary)

git branch -m master main

Push to a GitHub repo

git remote add origin git@github.com:jp7internet/typescript-crud.git
git push -u origin main

Deploy to GitHub Pages

yarn deploy

Open

open https://jp7internet.github.io/typescript-crud
  • Replace "jp7internet" with your GitHub user name.
Clone this wiki locally