-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.36 KB
/
update-cloud-function.yaml
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
name: update-function
on:
workflow_call:
inputs:
service_name:
description: 'Which module to re-deploy'
required: true
default: 'service-dictionary'
type: string
workflow_dispatch:
inputs:
service_name:
description: 'Which module to re-deploy'
required: true
default: 'service-dictionary'
jobs:
deploy-workflow:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v3
- run: ls
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: 'projects/${{ vars.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/idpool/providers/idprovider'
service_account: ${{ vars.GCP_GITHUB_SERVICE_ACCOUNT }}
token_format: 'access_token'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
with:
version: '>= 363.0.0'
- name: 'Use gcloud CLI'
run: 'gcloud info'
- name: 'Use to deploy a cloud function gen 2'
run: 'gcloud functions deploy ${{ inputs.service_name }} --gen2 --runtime=nodejs18 --region=us-central1 --source=backend/${{ inputs.service_name }} --trigger-http --allow-unauthenticated --entry-point=main --memory=256MB --timeout=60s'