-
Notifications
You must be signed in to change notification settings - Fork 11
61 lines (52 loc) · 1.42 KB
/
deploy.yml
File metadata and controls
61 lines (52 loc) · 1.42 KB
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: Deploy
on:
workflow_call:
inputs:
env:
required: true
type: string
cloudflare:
required: false
type: boolean
default: false
secrets:
firebase-token:
required: true
cloudflare-token:
required: false
cloudflare-account-id:
required: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: ${{ github.ref_type == 'tag' && 1 || 0 }}
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm ci
working-directory: functions
- name: Set env
run: |
echo "REACT_APP_VERSION=$(git describe --tags HEAD|sed s/^v//)" >> $GITHUB_ENV
- run: npm run build:${{ inputs.env }}
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: >-
deploy
-P ${{ inputs.env }}
--only database,functions${{ !inputs.cloudflare && ',hosting' || '' }}
env:
FIREBASE_TOKEN: ${{ secrets.firebase-token }}
- name: Deploy to Cloudflare
if: inputs.cloudflare
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.cloudflare-token }}
accountId: ${{ secrets.cloudflare-account-id }}
wranglerVersion: "4.65.0"
command: deploy