Skip to content

fix: use node 20 following github workflow removing support for node 16 #30

fix: use node 20 following github workflow removing support for node 16

fix: use node 20 following github workflow removing support for node 16 #30

name: Deploy NestJS API to Firebase
on:
push:
branches:
- main
- dev
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
actions: write
checks: write
contents: write
deployments: write
id-token: write # This is required for requesting the JWT
issues: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
steps:
- uses: actions/checkout@v4
with:
repository: github/actions-oidc-debugger
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
path: ./.github/actions/actions-oidc-debugger
- name: Debug OIDC Claims
uses: ./.github/actions/actions-oidc-debugger
with:
audience: 'projects/970886652672/locations/global/workloadIdentityPools/dev-ci-pool/providers/my-repo-oidc'
- name: Set correct firebase project based on git branch.
run: echo "FIREBASE_PROJECT=$(if [ ${{ github.ref }} == 'refs/heads/main' ]; then echo 'prod'; else echo 'dev'; fi)" >> $GITHUB_ENV
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ env.FIREBASE_PROJECT }}
workload_identity_provider: 'projects/970886652672/locations/global/workloadIdentityPools/dev-ci-pool/providers/my-repo-oidc'
# service_account: '[email protected]'
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies.
run: npm install
- name: Deploy to firebase cloud functions.
uses: w9jds/[email protected]
with:
args: deploy --only functions --project ${{ env.FIREBASE_PROJECT }}
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}