Quick Steps For Deploying React Applications to Github Pages

This tutorial assumes that you have some knowledge of how to use React and Git.

Deploying React Applications to Github Pages is not rocket science.

In this article, I’ll be showing you how to deploy your React application to gh-pages in no time.

First, I have created the monsters-rolodex app using create-react-app. The app source code is in https://github.com/gleniox/monsters-rolodex

After the React app creation, follow these steps:

  1. Open your package.json
  2. Change the “homepage” property, following this format https://[github name].github.io/[repository name]

3. Make sure your “scripts” is like that

4. Install the gh-pages package from npm. In the terminal, run: npm install gh-pages

5. In the terminal, run this command npm run deploy

6. Open the published app (e.g. https://gleniox.github.io/monsters-rolodex/)

and… happy hacking! :)

--

--

Glenio Alexandre Nogueira

Brazilian-Canadian. Full-stack Developer. Coffee and Photography enthusiast. (gleniox.github.io/)