-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (57 loc) · 1.63 KB
/
gcp_deploy.yml
File metadata and controls
62 lines (57 loc) · 1.63 KB
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
name: Deploy Evaluation Function to GCP
on:
workflow_call:
inputs:
environment:
type: string
description: "The environment to deploy to"
required: false
api-url:
type: string
description: "The URL of the backend API"
required: false
image-name:
type: string
description: "The name of the Docker image to deploy"
required: true
function-name:
type: string
description: "The name of the Lambda function to deploy"
required: true
region:
type: string
description: "The GCP region to deploy to"
default: "europe-west2"
required: false
repo:
type: string
description: "The image repo"
required: true
secrets:
function-admin-api-key:
description: "The API key for the Lambda Feedback function admin API"
required: false
gcp_credentials:
description: "The JSON key for deploying to GCP"
required: true
jobs:
deploy:
name: Deploy (${{ inputs.environment }})
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: 'actions/checkout@v4'
- id: 'auth'
uses: 'google-github-actions/auth@v3'
with:
credentials_json: '${{ secrets.gcp_credentials }}'
- id: 'deploy'
run: |
gcloud run deploy ${{inputs.function-name}} \
--image ${{inputs.repo}}/${{inputs.image-name}} \
--region ${{inputs.region}} \
--platform managed \
--allow-unauthenticated