| # Copyright 2023 The Go Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style |
| # license that can be found in the LICENSE file. |
| |
| steps: |
| # Build the container image |
| - name: "gcr.io/cloud-builders/docker" |
| dir: 'godev' |
| args: |
| - "build" |
| - "-t" |
| - "gcr.io/$PROJECT_ID/telemetrygodev:$COMMIT_SHA" |
| - "-f" |
| - "cmd/telemetrygodev/Dockerfile" |
| - "." |
| # Push the container image to Container Registry |
| - name: "gcr.io/cloud-builders/docker" |
| args: ["push", "gcr.io/$PROJECT_ID/telemetrygodev:$COMMIT_SHA"] |
| # Deploy container image to Cloud Run |
| - name: "gcr.io/google.com/cloudsdktool/cloud-sdk" |
| entrypoint: gcloud |
| args: |
| - "run" |
| - "deploy" |
| - "$_SERVICE" |
| - "--image" |
| - "gcr.io/$PROJECT_ID/telemetrygodev:$COMMIT_SHA" |
| - "--region" |
| - "us-central1" |
| images: |
| - "gcr.io/$PROJECT_ID/telemetrygodev:$COMMIT_SHA" |