-
-
Notifications
You must be signed in to change notification settings - Fork 9
57 lines (47 loc) · 1.45 KB
/
deploy-gcp.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
name: Deploy Cloud Functions
on:
schedule:
# 00:00 (UTC)
- cron: "00 00 * * *"
workflow_dispatch:
inputs:
mypy_version:
description: mypy version
required: true
type: string
default: master
runtime:
description: Runtime version
required: true
type: string
default: python312
permissions:
contents: read
id-token: write
env:
MYPY_VERSION: ${{ github.event.inputs.mypy_version || 'master' }}
RUNTIME: ${{ github.event.inputs.runtime || 'python312' }}
jobs:
gcp-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Add mask
run: echo "::add-mask::${{ secrets.GCP_PROJECT }}"
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Use gcloud CLI
run: gcloud info
- name: Deploy Cloud Function
run: ./deploy.sh ${{ env.MYPY_VERSION }}
working-directory: ./sandbox/cloud_functions
env:
REGION: ${{ secrets.GCP_REGION }}
RUNTIME: ${{ env.RUNTIME }}
INVOKER_MEMBER: ${{ secrets.GCP_INVOKER_MEMBER }}
SERVICE_ACCOUNT: ${{ secrets.GCP_FUNCTION_SERVICE_ACCOUNT }}