-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.34 KB
/
push.functions.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
name: Push Events (Functions)
on:
push:
branches:
- main
- dev
paths:
- "src/functions/**"
- ".github/workflows/push.functions.yml"
concurrency:
group: "${{ github.head_ref || github.ref }}-functions"
cancel-in-progress: true
jobs:
deploy-dev:
name: Deploy to dev
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
environment:
name: dev
steps:
- name: ⬇️ Set up code
uses: actions/checkout@v4
with:
show-progress: false
- id: auth
name: 🗝️ Authenticate to Google Cloud
uses: google-github-actions/auth@v1
with:
create_credentials_file: true
token_format: access_token
workload_identity_provider: ${{ secrets.IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
- name: 🚀 Deploy Cloud Function
id: deploy
uses: google-github-actions/deploy-cloud-functions@v1
with:
name: pdf
runtime: nodejs20
source_dir: src/functions
entry_point: generate
service_account_email: cloud-function-sa@${{ secrets.PROJECT_ID }}.iam.gserviceaccount.com
https_trigger_security_level: "secure_always"
timeout: "2m"
env_vars: BUCKET=${{ vars.BUCKET }}