Last active
February 27, 2021 20:13
-
-
Save Sunnepah/2a1514a23c66230a81c391aab1cf2be6 to your computer and use it in GitHub Desktop.
Google Cloudbuild.yaml to build, push image to gcr and deploy to cloud run service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
# build the container image | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['build', '-t', 'eu.gcr.io/[google-cloud-yourproject]/[app-name]:latest', '.'] # change eu.gcr.io to your region | |
# push the container image to Container Registry | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['push', 'eu.gcr.io/[google-cloud-yourproject]/[app-name]:latest'] | |
# Deploy container image to Cloud Run | |
- name: 'gcr.io/cloud-builders/gcloud' | |
args: ['beta', 'run', 'deploy', '[cloudrun-service-name]', '--image', 'eu.gcr.io/[google-cloud-yourproject]/[app-name]:latest', '--region', '[europe-west1]', '--platform', 'managed'] | |
images: | |
- "eu.gcr.io/[google-cloud-yourproject]/[app-name]:latest" | |
options: | |
machineType: 'N1_HIGHCPU_8' | |
timeout: 900s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment