-
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (48 loc) · 1.79 KB
/
firebase_deploy_prod.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
name: Firebase Deploy Prod
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-Prod
cancel-in-progress: true
jobs:
deploy:
timeout-minutes: 30
runs-on: ubuntu-latest
permissions: # for KoheiKanagu/composite-actions/setup-firebase-cli@main
id-token: write
contents: read
steps:
### Setup ###
- uses: actions/checkout@v4.2.1
- name: Setup Firebase CLI
uses: KoheiKanagu/composite-actions/setup-firebase-cli@main
with:
workload_identity_provider: ${{ vars.WORKLOAD_IDENTITY_PROVIDER_PROD }}
service_account: ${{ vars.SERVICE_ACCOUNT_PROD }}
- run: |
firebase use prod --debug
- name: Copy Remote Config Template
run: |
cp firebase/remoteconfig/template.prod.json firebase/remoteconfig/template.json
- name: Install dependencies
run: npm ci
working-directory: firebase/functions
### Deploy ###
- name: Deploy Mail Templates
working-directory: firebase/functions
run: |
# https://github.com/firebase/firebase-admin-node/issues/1377
# Workaround for the issue above
echo ${{ secrets.FIREBASE_ADMIN_SDK_SERVICE_ACCOUNT_PROD }} | base64 --decode > service-account.json
# GOOGLE_APPLICATION_CREDENTIALS is only used in the current shell
export GOOGLE_APPLICATION_CREDENTIALS=$GITHUB_WORKSPACE/firebase/functions/service-account.json
npx tsx scripts/set-mail-templates.ts --force
npx tsx scripts/set-service-status-up.ts --force
- name: Firebase Deploy
run: |
firebase deploy --force --except extensions
### Cleanup ###
- name: Cleanup
if: always()
run: |
rm -f service-account.json