-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (36 loc) · 1.06 KB
/
firebase-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Deploy Cloud Functions
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'functions/**'
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/functions/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Create env file
run: |
echo "${{ secrets.ENV_FILE }}" > .env
working-directory: functions
- name: Build Cloud Functions
run: npm ci
working-directory: functions
- name: Create SA key
run: echo '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}' > $HOME/gcloud.json
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Deploy Cloud Functions
run: export GOOGLE_APPLICATION_CREDENTIALS=$HOME/gcloud.json && npm run deploy
working-directory: functions