26 lines
945 B
YAML
26 lines
945 B
YAML
# Build + push + deploy the backend. Run from the repo root:
|
|
# gcloud builds submit --config apps/backend/cloudbuild.yaml \
|
|
# --substitutions=_REGION=us-central1,_IMAGE=us-central1-docker.pkg.dev/PROJECT/cerebrus/backend .
|
|
steps:
|
|
- name: gcr.io/cloud-builders/docker
|
|
args: ["build", "-f", "apps/backend/Dockerfile", "-t", "${_IMAGE}:${BUILD_ID}", "-t", "${_IMAGE}:latest", "."]
|
|
- name: gcr.io/cloud-builders/docker
|
|
args: ["push", "--all-tags", "${_IMAGE}"]
|
|
- name: gcr.io/google.com/cloudsdktool/cloud-sdk
|
|
entrypoint: gcloud
|
|
args:
|
|
- "run"
|
|
- "deploy"
|
|
- "cerebrus-backend"
|
|
- "--image=${_IMAGE}:${BUILD_ID}"
|
|
- "--region=${_REGION}"
|
|
- "--platform=managed"
|
|
- "--port=8080"
|
|
- "--allow-unauthenticated"
|
|
images:
|
|
- "${_IMAGE}"
|
|
substitutions:
|
|
_REGION: "us-central1"
|
|
_IMAGE: "us-central1-docker.pkg.dev/${PROJECT_ID}/cerebrus/backend"
|
|
options:
|
|
logging: CLOUD_LOGGING_ONLY
|