GCP · Developer Tools
Cloud Build
Serverless CI/CD pipelines.
Official docsOverview
Cloud Build executes containerized build steps triggered by source pushes, manual runs or Pub/Sub events.
When to use it
- Build → test → deploy pipelines
- Cross-repo orchestration
- Triggering nightly QA jobs
Setup
- Enable Cloud Build API and connect your repository (GitHub/Bitbucket/Cloud Source).
- Add `cloudbuild.yaml` with build steps.
- Create trigger: branch, tag or Pub/Sub.
How to use
Minimal cloudbuild.yaml
steps:
- name: node:20
entrypoint: bash
args: [-c, 'npm ci && npm test']
- name: 'gcr.io/cloud-builders/docker'
args: ['build','-t','us-docker.pkg.dev/$PROJECT_ID/images/api:$SHORT_SHA','.']
images: ['us-docker.pkg.dev/$PROJECT_ID/images/api:$SHORT_SHA']QA use cases
- Run Playwright in a parallel step and upload report to GCS.
- Gate deploy step on test result success.
