- Firebase Account
- npm 5.2+
- Check
npm
version
npm --version
- Create a new single-page application in React
npx create-react-app react-demo-085
- Change directory to the app
cd react-demo-085
- Inspect the folder content
code .
- Run react locally
npm start
-
Go to Firebase
-
Click
Go to console
-
Click
Create a project
-
Create
react-demo-085
Firebase project
- Install the Firebase CLI
npm install -g firebase-tools
- Log in and test the Firebase CLI
firebase login
- Test that the CLI is properly installed and accessing your account by listing your Firebase projects.
firebase projects:list
- Build for React application
npm run build
- Initialize your project
firebase init hosting
- Deploy to your site
firebase deploy --only hosting
-
Open hosting URL
-
Check TLS certificate
-
Go to Firebase console
-
Navigate to
Hosting
-
Click
Add custom domain
-
Enter your domain, in my case
devopsbyexample.io
-
Create A record for your domain
-
Optionally add
www
subdomain
-
Create GitHub repo
react-demo-085
, let's make it private -
Add existing repository
git remote add origin [email protected]:antonputra/react-demo-085.git
git add .
git commit - 'init commit'
git push origin main
- Reinitialize Firebase hosting
firebase init hosting
- Create new branch for new feature
git checkout -b feature-x
-
Modify
src/App.js
-
Commit, push and create PR
git add .
git commit -m 'Add new feature X'
git push origin feature-x
- Go to
Actions
in GitHub repo
-
Remove
react-demo-085
firebase project -
Remove
firebase-tools
npm uninstall -g firebase-tools
-
Remove
react-demo-085
GitHub repo -
Remove DNS records
-
Log out from Firebase
firebase logout