9
9
name : Deploy
10
10
runs-on : ubuntu-latest
11
11
permissions :
12
+ # Needed to produce an OIDC token, which is used for Workload Identity Federation with Google Cloud
12
13
id-token : write
13
14
contents : read
14
-
15
15
steps :
16
- # - name: Checkout actions-oidc-debugger
17
- # uses: actions/checkout@v3
18
- # with:
19
- # repository: github/actions-oidc-debugger
20
- # ref: main
21
- # # token: ${{ secrets.your-checkout-token }}
22
- # path: ./.github/actions/actions-oidc-debugger
23
- # - name: Debug OIDC Claims
24
- # uses: ./.github/actions/actions-oidc-debugger
25
- # with:
26
- # audience: '${{ github.server_url }}/${{ github.repository_owner }}'
27
-
28
16
- name : Check out repo
29
17
uses : actions/checkout@v4
30
18
with :
35
23
node-version : ' 20.x'
36
24
- name : Install firebase-tools
37
25
run : npm install -g firebase-tools
38
- # - name: Authenticate to Google
39
- # uses: 'google-github-actions/auth@v2'
40
- # with:
41
- # credentials_json: ${{ secrets.GCP_SA_KEY }}
42
- # create_credentials_file: true
43
- # export_environment_variables: true
44
- # cleanup_credentials: true
45
26
- name : Authenticate to Google
46
27
uses : ' google-github-actions/auth@v2'
47
28
with :
@@ -51,24 +32,17 @@ jobs:
51
32
create_credentials_file : true
52
33
export_environment_variables : true
53
34
cleanup_credentials : true
54
- - name : List firebase projects
55
- run : firebase projects:list
56
- - name : Output auth details
57
- run : cat $GOOGLE_APPLICATION_CREDENTIALS
58
35
- name : Install dependencies
59
36
run : npm install
60
37
working-directory : checkout-prefix
61
38
- name : Build
62
39
run : npm run build
63
40
working-directory : checkout-prefix
64
- # - name: Output directory
65
- # run: ls
66
- # - name: Output checkout directory
67
- # run: ls checkout-prefix
68
41
- name : Deploy functions
42
+ id : deployFunctions
69
43
run : npm run deploy
70
44
working-directory : checkout-prefix
71
- - name : Output firebase debug log
72
- if : always()
45
+ - name : Output firebase debug log on deployment failure
46
+ if : always() && (steps.deployFunctions.outcome == 'failure')
73
47
run : cat firebase-debug.log
74
48
working-directory : checkout-prefix
0 commit comments