Skip to content

Deploy Firebase Functions #14

Deploy Firebase Functions

Deploy Firebase Functions #14

name: Deploy Firebase Functions
on:
workflow_dispatch:
inputs:
target-bucket:
type: string
required: true
function-name:
type: string
required: true
projects:
description: "Comma-separated list of projects"
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
project: ${{ inputs.projects && inputs.projects != '' && inputs.projects.split(',') || '' }}

Check failure on line 23 in .github/workflows/firebaseFunctionDeploy.yml

View workflow run for this annotation

GitHub Actions / Deploy Firebase Functions

Invalid workflow file

The workflow is not valid. .github/workflows/firebaseFunctionDeploy.yml (Line: 23, Col: 18): Unexpected symbol: '('. Located at position 66 within expression: inputs.projects && inputs.projects != '' && inputs.projects.split(',') || '' .github/workflows/firebaseFunctionDeploy.yml (Line: 23, Col: 18): Unexpected value '${{ inputs.projects && inputs.projects != '' && inputs.projects.split(',') || '' }}'
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
- name: Create .env file
run: |
cd functions
echo "TARGET_BUCKET=${{ inputs.target-bucket }}" > .env
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Install dependencies
run: |
cd functions
npm install
- name: Deploy Firebase Functions
run: |
echo '${{ secrets.GCP_SA_KEY }}' > $HOME/gcp-key.json
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/gcp-key.json"
firebase deploy --only functions:${{ inputs.function-name }} --project=${{ matrix.project }}