A GitHub Action to deploy to Firebase Hosting using firebase-tools CLI.
Creating your workflow to build and deploy to Firebase Hosting.
name: Build and Deploy
on:
push:
branches: master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@master
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: dist
path: dist
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@master
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: dist
- name: Deploy to Hosting
uses: mvmjacobs/firebase-action@master
with:
args: deploy --only hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
-
args
: This is the arguments thatfirebase
command will run. -
FIREBASE_TOKEN
: The token to use for authentication.- You can get a token with
firebase login:ci
- For information about using secrets in GitHub Actions please see the Github Action Docs for Encrypted Secrets.
- You can get a token with
This repository is licensed under the MIT License.