Deploy Firebase Functions #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
|
||
| 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 }} | ||