forked from privacy-scaling-explorations/p0tion
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (60 loc) · 2.23 KB
/
firebase-deploy-dev.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Deploy to Firebase Dev Environment
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: Update package.json dependencies and names
run: |
# Enable recursive globbing
shopt -s globstar
# Update package.json dependencies
sed -i -e 's/"@ethstorage-org\/actions": "[^"]*"/"@devtion\/actions": "latest"/g' ./packages/backend/package.json
# Update string literals in TypeScript files
find packages -type f -name '*.ts' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|devtion/actions|g' {} +
cat ./packages/backend/package.json
cat ./packages/backend/src/functions/ceremony.ts
- name: Install npm packages and write env
run: |
yarn install
echo "${{ secrets.ACTIONS_ENV_FILE }}" > ./packages/actions/.env
echo "${{ secrets.BACKEND_ENV_FILE }}" > ./packages/backend/.env
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: "false"
- 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: docker://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