Publish React App From create-react-app to Github

J.A. ShezanJ.A. Shezan
1 min read

Publish your React.js application made with create-react-app to github easily with these commands.

⌨️ Commands Used

Step 0 (Create Repository in Github)

Create a Repository in github and collect the github repository remote url

Step 1 (Push The Repo To Github)

Put your repository link here

git remote add origin YOUR_REPO_LINK
git add -A
git commit -m "Initial commit"
git push -u origin main

Step 2 (Add Home Page for the app)

Replace jashezan with your github username. Also provide the repository link of your react app on github.

"homepage": "https://jashezan.github.io/[YOUR REPO NAME]",

Step 3 (Install gh-pages as Dev Dependency)

npm install gh-pages --save-dev

Step 4 (Deploy the React.js App with scripts)

"predeploy": "npm run build",
"deploy": "gh-pages -d build",
npm run deploy

Source video: https://www.youtube.com/watch?v=2hM5viLMJpA

0
Subscribe to my newsletter

Read articles from J.A. Shezan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

J.A. Shezan
J.A. Shezan

Shezan loves technology who is currently studying Computer Science and Engineering. He codes frontend & backend of a website. He also does penetration testing on web apps.