Skip to main content

Command Palette

Search for a command to run...

Publish React App From create-react-app to Github

Free hosting for your react application easily with github

Updated
1 min read
Publish React App From create-react-app to Github
J

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.

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

Frontend Odyssey

Part 2 of 5

Dive into React, Next.js, and more! Join our Hashnode series for frontend insights and tricks. Elevate your skills and build stunning web apps!

Up next

Step-by-Step Guide to Configuring Husky and Lint-Staged with ESLint and Prettier

Learn to Configure Husky and Lint-Staged with ESLint and Prettier: A Simple Guide