Skip to content

sirishgf pushed to branch and triggered deploy #16

sirishgf pushed to branch and triggered deploy

sirishgf pushed to branch and triggered deploy #16

name: Deploy to Firebase Functions
run-name: ${{ github.actor }} pushed to branch and triggered deploy
on:
push:
branches: ["main", "feature/*"]
workflow_dispatch:
jobs:
integration:
uses: ./.github/workflows/node-ci-workflow.yml
permissions:
contents: read
checks: write
build_and_deploy:
needs: [integration]
runs-on: ubuntu-22.04
timeout-minutes: 5
# environment: dev
steps:
- uses: actions/checkout@v4
- name: Set up Node v18
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
working-directory: .
run: find ./* -maxdepth 1 -name package.json -execdir npm ci \;
- 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 --project ${{ vars.FIREBASE_PROJECT }}
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.auth.outputs.credentials_file_path }}
- name: Retry deploy function to Firebase
id: retry-deploy-step
if: steps.initial-deploy-step.outcome == 'failure'
run: npx firebase-tools deploy --only functions --project ${{ vars.FIREBASE_PROJECT }} --debug
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.auth.outputs.credentials_file_path }}