Created
January 12, 2021 07:20
-
-
Save Timtech4u/619f5e69e077cf9e4bdd0959881406bd to your computer and use it in GitHub Desktop.
Generic Cloud Build
This file contains hidden or 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 and push container | |
- name: "gcr.io/kaniko-project/executor:latest" | |
args: ["--cache=true", "--cache-ttl=48h", "--destination=gcr.io/$PROJECT_ID/$REPO_NAME:$BRANCH_NAME"] | |
# deploy container image to Cloud Run with env vars | |
- name: "gcr.io/cloud-builders/gcloud" | |
args: ['run', 'deploy', '$REPO_NAME', '--image', 'gcr.io/$PROJECT_ID/$REPO_NAME:$BRANCH_NAME', '--region', 'europe-west4', '--allow-unauthenticated', '--platform', 'managed', '--update-env-vars', 'NODE_ENV=prod'] | |
# set full traffic to latest revision (needed if rollback was performed) | |
- name: "gcr.io/cloud-builders/gcloud" | |
args: ['run', 'services', 'update-traffic', '$REPO_NAME', '--to-latest', '--region', 'europe-west4', '--platform', 'managed'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment