# 由 deploy/deploy-cloudrun.sh 调用:
#   gcloud builds submit . --config deploy/cloudbuild.yaml --substitutions ...
# 构建上下文是 code/ 目录(不含 .git,版本信息经 substitutions 传入)。
substitutions:
  _IMAGE_URI: ''
  _GIT_COMMIT: ''
  _GIT_COMMIT_SHORT: ''
  _GIT_COMMIT_DATE: ''
steps:
  - name: gcr.io/cloud-builders/docker
    args:
      - build
      - --tag=${_IMAGE_URI}
      - --build-arg=GIT_COMMIT=${_GIT_COMMIT}
      - --build-arg=GIT_COMMIT_SHORT=${_GIT_COMMIT_SHORT}
      - --build-arg=GIT_COMMIT_DATE=${_GIT_COMMIT_DATE}
      - .
images:
  - ${_IMAGE_URI}
