-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (66 loc) · 2.3 KB
/
cd.yml
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
name: Deploy to Google Cloud
on:
push:
branches: [cd]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
# - name: Checkout actions-oidc-debugger
# uses: actions/checkout@v3
# with:
# repository: github/actions-oidc-debugger
# ref: main
# # token: ${{ secrets.your-checkout-token }}
# path: ./.github/actions/actions-oidc-debugger
# - name: Debug OIDC Claims
# uses: ./.github/actions/actions-oidc-debugger
# with:
# audience: '${{ github.server_url }}/${{ github.repository_owner }}'
- name: Check out repo
uses: actions/checkout@v4
with:
path: checkout-prefix
- name: Install firebase-tools
run: npm install -g firebase-tools
# - name: Authenticate to Google
# uses: 'google-github-actions/auth@v2'
# with:
# credentials_json: ${{ secrets.GCP_SA_KEY }}
# create_credentials_file: true
# export_environment_variables: true
# cleanup_credentials: true
- name: Authenticate to Google
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: 'projects/705985154569/locations/global/workloadIdentityPools/kipr-github-identity-pool/providers/github'
project_id: 'kipr-321905'
service_account: 'simulator-cloud-functions-gith@kipr-321905.iam.gserviceaccount.com'
create_credentials_file: true
export_environment_variables: true
cleanup_credentials: true
- name: List firebase projects
run: firebase projects:list
- name: Output auth details
run: cat $GOOGLE_APPLICATION_CREDENTIALS
- name: Install dependencies
run: npm install
working-directory: checkout-prefix
- name: Build
run: npm run build
working-directory: checkout-prefix
# - name: Output directory
# run: ls
# - name: Output checkout directory
# run: ls checkout-prefix
- name: Deploy functions
run: npm run deploy
working-directory: checkout-prefix
- name: Output firebase debug log
if: always()
run: cat firebase-debug.log
working-directory: checkout-prefix