martin vicknair

Deploy react app to github pages

This exercise will help you connect your create-react-app repository on GitHub to its associated GitHub Page. The end result will be to have your code viewable at GitHub as normal, and also have your deployed project viewable at its github.io/project-name web-address. GitHub Pages is a static site hosting service and doesn’t support server-side code such as PHP, Ruby, or Python, but since React is JavaScript, there is no problem. This trick is to host your code master and any other branches as normal, but to send your deployed build to the gh-pages branch for display.

This exercise assumes you have a create-react-app project on your local development machine, and a a connected GitHub repository.

We know that by running yarn start we can have the development build running on our local machine, accessible at localhost:3000.

The idea is to have your deploy build be hosted on the gh-pages option of GitHub pages.