- Deploy your Extensions to a staging project whenever a new PR is opened
- Comments a link to view your Extensions in the Firebase console on each PR
- Deploys the current state of your GitHub repo to your prod project when the PR is merged.
A guide on how to save your Extensions config locally can be found in the Firebase Extensions docs.
Add a workflow (.github/workflows/deploy-staging.yml
):
name: Deploy to Staging
on:
pull_request:
# Optionally configure to run only for specific files. For example:
# paths:
# - "extensions/**"
jobs:
build_and_preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: FirebaseExtended/action-extensions-deploy@v0-alpha5
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
project: your-staging-project-ID
Add a workflow (.github/workflows/deploy-production.yml
):
name: Deploy to Prod
on:
push:
branches:
- main
# Optionally configure to run only for specific files. For example:
# paths:
# - "extensions/**"
jobs:
deploy_extensions_to_prod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Add any other steps here.
- uses: FirebaseExtended/action-extensions-deploy@v0-alpha5
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
project: your-prod-project-ID
This is a service account JSON key. You'll need to create it manually.
It's important to store this token as an
encrypted secret
to prevent unintended access to your Firebase project. Set it in the "Secrets" area
of your repository settings and add it as FIREBASE_SERVICE_ACCOUNT
:
https://github.com/USERNAME/REPOSITORY/settings/secrets
.
Adding repoToken: "${{secrets.GITHUB_TOKEN}}"
lets the action comment on PRs
with a link to view your newly deployed Extensions in the Firebase Console. You don't need to set
this secret yourself - GitHub sets it automatically.
If you omit this option, you'll need to find the preview URL in the action's build log.
The Firebase project that contains the Hosting site to which you
want to deploy. If left blank, you need to check in a .firebaserc
file so that the Firebase CLI knows which Firebase project to use.
The location of your firebase.json
file relative to the root of your repository. Defaults to .
(the root of your repo).
This repository is maintained by Joe Hanley, but is not a supported Firebase product. Issues here are answered by maintainers and other community members on GitHub on a best-effort basis.