In this short video, we will use the awesome GitHub Pages feature to deploy our React.js app for free. You can even add a custom domain later! This technique would also work for other static websites too. Hope you enjoy the video and find it useful!
----------------------------------------------------------
⌨️ Commands Used
----------------------------------------------------------
Step 1
▶️ git remote add origin [YOUR REPO LINK]
▶️ git add -A
▶️ git commit -m "Initial commit"
▶️ git push -u origin main
Step 2
"homepage": "https://[USERNAME].github.io/[YOUR REPO NAME]",
Step 3
▶️ npm install gh-pages --save-dev
Step 4
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
▶️ npm run deploy
----------------------------------------------------------
⏰ Timestamps
----------------------------------------------------------
0:00 Introduction
0:25 Step 1 (Get your React app on GitHub)
2:11 Step 2 (Add final URL to package.json)
3:33 Step 3 (Add gh-pages npm package)
4:06 Step 4 (Create deploy scripts and deploy!)
----------------------------------------------------------
📚 Resources
----------------------------------------------------------
Editor (Visual Studio Code): https://code.visualstudio.com/
Web Browser (Firefox Developer Edition): https://www.mozilla.org/en-GB/firefox/developer/
Terminal (iTerm, Mac only): https://iterm2.com/
MDN (where I reference JavaScript documentation): https://developer.mozilla.org/en-US/docs/Web/JavaScript
----------------------------------------------------------
🔗 My Links
----------------------------------------------------------
GitHub: https://github.com/jrgrimshaw/
Instagram: https://instagram.com/jrgrimshaw
LinkedIn: https://linkedin.com/in/jrgrimshaw
Personal site: https://jgrimshaw.com
#jamesgrimshaw #react