- Fork it
- On terminal
npm install -g firebase-tool
firebase login
firebase init
- Choose a project or create a new one
- Firebase hosting (first option)
- Choose your forked repository on github
- Choose "/" as public folder
- don't rewrite index or 404
- All else is standard, auto deploy when PR is your choice. If you have no idea, choose no.
- When init is done add .[filename] files to gitignore and publish changes to github
- On terminal
firebase deploy
- Access the page at the address provided
- Make sure
.yml
file at.github/workflows/
has the structure below.
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Deploy hosting
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_[YOUR_PROJECT_ID] }}'
channelId: live
projectId: [your-project-id]
- Locate index.html, open it and refresh at each file save to check result
- Push changes and check address provided