Skip to content

Project structure updated #14

Project structure updated

Project structure updated #14

name: Deploy to Firebase Functions via github action
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build_and_deploy:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Download dependencies
working-directory: .
run: npm install
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
- name: Deploy function to Firebase
id: initial-deploy-step
continue-on-error: true
run: npx firebase-tools deploy --only functions:updateDashboard --project ${{ secrets.FIREBASE_PROJECT }}
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.auth.outputs.credentials_file_path }}
- name: Deploy function to Firebase
id: retry-deploy-step
if: steps.initial-deploy-step.outcome == 'failure'
run: npx firebase-tools deploy --only functions:updateDashboard --project ${{ secrets.FIREBASE_PROJECT }} --debug
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.auth.outputs.credentials_file_path }}