A GitHub Action to deploy to Firebase Hosting
- You can choose a specific branch to allow deployment by using the
TARGET_BRANCHenv var (masterif not specified). - Make sure you have the
firebase.jsonfile in the repository - Get the Firebase token by running
firebase login:ciand store it as theFIREBASE_TOKENsecret - Set the project name in the
FIREBASE_PROJECTenv var
Example workflow
name: Build and Deploy
on:
push:
branches:
- main
jobs:
main:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
- name: Build Hugo
uses: lowply/build-hugo@v0.68.3
- name: Deploy to Firebase
uses: lowply/deploy-firebase@v0.0.3
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_PROJECT: name-of-the-project
TARGET_BRANCH: main