Skip to content

Deploy to Firebase Cloud Functions (only functions)

Actions
A GitHub Action to deploy to Firebase Cloud Functions
v0.0.4
Latest
Star (1)

Deploy to Firebase for current stable version of Node

A GitHub Action to deploy to Firebase for current stable version of Node.

  • Make sure that you checkout the repository using the actions/checkout action
  • Make sure that you have the firebase.json file in the repository
  • To obtain the Firebase token, run firebase login:ci on your local computer and store the token as the FIREBASE_TOKEN secret
  • To obtain service account credentials, get the service account JSON file from Firebase console and set its path to GOOGLE_APPLICATION_CREDENTIALS
  • Either FIREBASE_TOKEN or GOOGLE_APPLICATION_CREDENTIALS are required to deploy the project. No need to set both at the same time.
  • Specify the Firebase project name in the FIREBASE_PROJECT env var

Workflow examples

Deploy 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: dheshalj/[email protected]
      env:
        FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
        FIREBASE_PROJECT: firebase-project-id

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: dheshalj/[email protected]
      env:
        FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
        FIREBASE_PROJECT: firebase-project-id

Deploy to Firebase Cloud Functions (only functions) is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

A GitHub Action to deploy to Firebase Cloud Functions
v0.0.4
Latest

Deploy to Firebase Cloud Functions (only functions) is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.