A GitHub Action to deploy to Firebase Hosting.
firebase.json
file in the repositoryfirebase login:ci
on your local computer and store the token as the FIREBASE_TOKEN
secretFIREBASE_PROJECT
env varDeploy the main
branch when a commit is pushed to it:
name: Deploy the main branch
on:
push:
branches:
- main
jobs:
main:
name: Deploy to Firebase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: lowply/[email protected]
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_PROJECT: name-of-the-project
Deploy only when a tag starts with v
is pushed:
name: Deploy a tag
on:
push:
tags:
- v*
jobs:
main:
name: Deploy to Firebase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: lowply/[email protected]
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_PROJECT: name-of-the-project