We can easily deploy our live react projects freely with github
First of all we need to install keep the installed all recommended elements for creating a react app
like Node, editor, browser, etc one more thing GIT and GitHub also
GIT is mandatory
![]() |
| Deploy React app Free with GitHub | IndianTechnoEra |
1. Open the command prompt in any folder and perform the commands
mkdir ReactProject
cd ReactProject
npm init react-app my-project-name
cd sam-counter-app
npm start
ctrl+c -->y for stop
npm install gh-pages --save -dev
2. Goto in package.jsom file in the project folder
a.) Add at top of the first array as key-value pair
"homepage": "http://snawaza243.github.io/my-created-repo",
The above link is the link of the created repository where our project will serve so create a repo in your GitHub account.
b.) Confirm the following key value in the dependencies section
"dependencies": {
"gh-pages": "^4.0.0",
}
c.) Add in the following key-value data in the script block
"predeploy":"npm run build",
"deploy":"gh-pages -d build",
3. Now again on the command prompt or terminal perform the following task
git add .
git commit -m "Deploy counter app sam-counter-app"
npm run deploy
git push -u origin or master
Key: How to host react app on github free?
