-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
38 lines (33 loc) · 1.18 KB
/
cloudbuild.yaml
File metadata and controls
38 lines (33 loc) · 1.18 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
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'us-south1-docker.pkg.dev/$PROJECT_ID/github-pr-bot/github-pr-bot:latest', '.']
# Push the container image to Artifact Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'us-south1-docker.pkg.dev/$PROJECT_ID/github-pr-bot/github-pr-bot:latest']
# Set IAM policy for Cloud Run (Ensure Cloud Build SA can deploy)
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'projects'
- 'add-iam-policy-binding'
- '$PROJECT_ID'
- '--member=serviceAccount:$PROJECT_NUMBER@cloudbuild.gserviceaccount.com'
- '--role=roles/run.admin'
# Deploy container image to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'github-pr-bot'
- '--image'
- 'us-south1-docker.pkg.dev/$PROJECT_ID/github-pr-bot/github-pr-bot:latest'
- '--region'
- 'us-central1'
- '--platform'
- 'managed'
- '--allow-unauthenticated'
images:
- 'us-south1-docker.pkg.dev/$PROJECT_ID/github-pr-bot/github-pr-bot:latest'
timeout: 1800s