-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
29 lines (26 loc) · 924 Bytes
/
cloudbuild.yaml
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
steps:
# Build the Docker image
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-t'
- 'gcr.io/qwiklabs-gcp-00-4976f22e9ecb/node-app:$COMMIT_SHA'
- '.'
# Push the Docker image to Google Container Registry (GCR)
- name: 'gcr.io/cloud-builders/docker'
args:
- 'push'
- 'gcr.io/qwiklabs-gcp-00-4976f22e9ecb/node-app:$COMMIT_SHA'
# Deploy to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args:
- 'run'
- 'deploy'
- 'my-cloudrun-service'
- '--image=gcr.io/qwiklabs-gcp-00-4976f22e9ecb/node-app:$COMMIT_SHA'
- '--platform=managed'
- '--region=us-central1' # Update with your desired region
- '--allow-unauthenticated' # Remove if authentication is required
options:
logging: CLOUD_LOGGING_ONLY # or NONE if you don't need logs
#logsBucket: 'devops-bucket-11' # Replace with your Cloud Storage bucket name