Skip to content

Instantly share code, notes, and snippets.

@guidani
Created February 8, 2022 16:13
Show Gist options
  • Save guidani/d8a61466f1e7d133a26f62a9b1946d3e to your computer and use it in GitHub Desktop.
Save guidani/d8a61466f1e7d133a26f62a9b1946d3e to your computer and use it in GitHub Desktop.
How to deplay a react app with github pages

Passo 0

  • Subir o projeto para um repositório no github.

Passo 1

  • instalar a dependencia: yarn add -D gh-pages.

Passo 2

  • Alterar o arquivo package.json adicionando as seguintes linhas:
{
  "homepage": http://<nome-de-usuario>.github.io/<nome-do-respositorio>,
  "scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment