-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 2.03 KB
/
firebase-deploy.yml
File metadata and controls
67 lines (58 loc) · 2.03 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
62
63
64
65
66
67
name: firebase deploy
on:
workflow_call:
inputs:
workload-identity-project-number:
description: the GCP project number used for Workload Identity Federation
required: true
type: string
environment:
description: The firebase project environment used for the deployment
required: true
type: string
gcp-service-account:
description: the email address of the service account
required: true
type: string
pre-deploy-command:
description: the command to run before the firebase deploy
required: false
type: string
working-directory:
description: The working directory of the firebase project
required: false
type: string
default: functions
concurrency:
group: firebase-deploy-${{ inputs.environment }}
jobs:
deploy:
name: Firebase deploy to ${{ inputs.environment }}
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: .tool-versions
cache: npm
cache-dependency-path: package-lock.json
- name: Install Dependencies
run: npm ci --ignore-scripts
- uses: valian-ca/github-workflows/.github/actions/gcp-github-auth@main
with:
workload-identity-project-number: ${{ inputs.workload-identity-project-number }}
gcp-service-account: ${{ inputs.gcp-service-account }}
- name: Configure firebase environment
run: npx firebase use ${{ inputs.environment }}
working-directory: ${{ inputs.working-directory }}
- name: Execute pre-deploy command
if: inputs.pre-deploy-command != ''
run: ${{ inputs.pre-deploy-command }}
working-directory: ${{ inputs.working-directory }}
- name: Firebase deploy
run: npx firebase deploy --force
working-directory: ${{ inputs.working-directory }}