forked from privacy-scaling-explorations/p0tion
-
Notifications
You must be signed in to change notification settings - Fork 36
58 lines (48 loc) · 1.57 KB
/
firebase-deploy.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Deploy to Firebase
on:
workflow_call:
inputs:
branch:
description: "Branch to deploy"
required: true
type: string
environment:
description: "Environment to deploy to"
required: true
type: string
firebase_project:
description: "The name of the Firebase project to deploy to"
required: true
type: string
jobs:
deploy-p0tion:
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"
- name: Install npm packages and write env
run: |
yarn install --immutable
echo "${{ secrets.ACTIONS_ENV_FILE }}" > ./packages/actions/.env
echo "${{ secrets.BACKEND_ENV_FILE }}" > ./packages/backend/.env
- name: build packages
run: yarn build
env:
NODE_OPTIONS: "--max_old_space_size=4096"
# Workaround for SSL error. (resource: https://github.com/firebase/firebase-admin-node/issues/1712)
- name: SSL Workaround
run: sudo sed -i '54 s/^/#/' /usr/lib/ssl/openssl.cnf
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only functions --project ${{ inputs.firebase_project }}
env:
GCP_SA_KEY: ${{ secrets.SERVICE_ACCOUNT_KEY }}
PROJECT_PATH: ./packages/backend