filmov
tv
How To Deploy React App on GitHub Pages #github #reactjs #coding

Показать описание
How To Deploy React App on GitHub Pages #github #reactjs #coding
✅ Step 1: Install gh-pages package
In your React project root, run:
npm install gh-pages --save-dev
"scripts": {
"deploy": "gh-pages -d build"
}
predeploy builds the app and deploy pushes the build/ folder to the gh-pages branch.
✅ Step 4: Push code to GitHub
Make sure your React app is already a git repo and pushed to GitHub:
git init
git add .
git commit -m "Initial commit"
git push -u origin main
✅ Step 5: Deploy!
Run this to deploy:
npm run deploy
✅ Step 1: Install gh-pages package
In your React project root, run:
npm install gh-pages --save-dev
"scripts": {
"deploy": "gh-pages -d build"
}
predeploy builds the app and deploy pushes the build/ folder to the gh-pages branch.
✅ Step 4: Push code to GitHub
Make sure your React app is already a git repo and pushed to GitHub:
git init
git add .
git commit -m "Initial commit"
git push -u origin main
✅ Step 5: Deploy!
Run this to deploy:
npm run deploy