-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcloudbuild.yml
33 lines (29 loc) · 954 Bytes
/
cloudbuild.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
steps:
# Build the container image using the docker builder
- name: "gcr.io/cloud-builders/docker"
args:
[
"build",
"-t",
"${_GCR_REGION}.gcr.io/$PROJECT_ID/${_SERVICE_NAME}:$COMMIT_SHA",
".",
]
# Push the container image to Container Registry (GCR)
- name: "gcr.io/cloud-builders/docker"
args:
["push", "${_GCR_REGION}.gcr.io/$PROJECT_ID/${_SERVICE_NAME}:$COMMIT_SHA"]
# Deploy the container image to Cloud Run
- name: "gcr.io/cloud-builders/gcloud"
args:
- run
- deploy
- ${_SERVICE_NAME}
- --image=${_GCR_REGION}.gcr.io/$PROJECT_ID/${_SERVICE_NAME}:$COMMIT_SHA
- --region=${_LOCATION}
- --platform=managed
images:
- "${_GCR_REGION}.gcr.io/$PROJECT_ID/${_SERVICE_NAME}:$COMMIT_SHA"
substitutions:
_LOCATION: us-central1 # must be substituted
_GCR_REGION: us # must be substituted
_SERVICE_NAME: service-name # must be substituted