A Technology Blog About Code Development, Architecture, Operating System, Hardware, Tips and Tutorials for Developers.

Monday, June 19, 2017

Deploy React Application as Github Pages

9:50:00 PM Posted by Satish Kumar , No comments
Note:
This feature is available with react-scripts@0.2.0 and higher.

Prerequisites:
  1. The project should be checked in to github.
  2. In project setting enable gh-pages

Step 1: Add homepage to package.json.


Step 2: Install gh-pages. 


Step 3: Add the following scripts in your package.json.


The pre-deploy script will run automatically before deploy is run.

Step 3: Now deploy the application by running the below command

I have deployed a sample app.

bulletin-board

Code in Github.com