-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (41 loc) · 1.43 KB
/
deploy-cloud-function.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
name: Deploy Google Cloud function
on:
push:
branches:
- release/google-cloud-functions
workflow_dispatch:
env:
GCP_PROJECT_NUMBER: 721298773786
GCP_PROJECT_ID: psalm-github-bot
GCP_FUNCTION_NAME: psalm-github-bot
GCP_IDENTITY_POOL: github
GCP_IDENTITY_PROVIDER: github
GCP_SERVICE_ACCOUNT: github-deployer@psalm-github-bot.iam.gserviceaccount.com
GH_APP_ID: 48546
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout built code
uses: actions/checkout@v4
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- id: auth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: "projects/${{ env.GCP_PROJECT_NUMBER }}/locations/global/workloadIdentityPools/${{ env.GCP_IDENTITY_POOL }}/providers/${{ env.GCP_IDENTITY_PROVIDER }}"
service_account: "${{ env.GCP_SERVICE_ACCOUNT }}"
- run: |
gcloud functions deploy ${{ env.GCP_FUNCTION_NAME }} \
--project=${{ env.GCP_PROJECT_ID }} \
--allow-unauthenticated \
--trigger-http \
--entry-point=probotApp \
--runtime=nodejs18 \
--gen2 \
--region=us-east4 \
--set-secrets='PRIVATE_KEY=PRIVATE_KEY:latest,WEBHOOK_SECRET=WEBHOOK_SECRET:latest' \
--set-env-vars='APP_ID=${{ env.GH_APP_ID }},LOG_LEVEL=debug'