-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (48 loc) · 1.44 KB
/
deploy-cloud-run.yml
File metadata and controls
54 lines (48 loc) · 1.44 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
name: Deploy to Cloud Run (Reusable)
on:
workflow_call:
inputs:
service_name:
description: "Cloud Run service name"
required: true
type: string
project_id:
description: "GCP project ID"
required: false
type: string
default: "arboreal-vision-339901"
region:
description: "GCP region"
required: false
type: string
default: "us-central1"
cloudbuild_config:
description: "Path to cloudbuild.yaml"
required: false
type: string
default: "cloudbuild.yaml"
secrets:
GCP_SA_KEY:
description: "GCP service account JSON key"
required: true
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Submit Cloud Build
run: |
echo "Deploying ${{ inputs.service_name }} to ${{ inputs.region }} in project ${{ inputs.project_id }}"
gcloud builds submit \
--config=${{ inputs.cloudbuild_config }} \
--project=${{ inputs.project_id }}