Cloud Build is a fully managed CI/CD service: Google Cloud handles the infrastructure, and you only describe the pipeline steps.

- Cloud Build executes builds as an ordered sequence of steps.
- Each step runs in its own container image for isolation and reproducibility.
- The pipeline converts source into deployable artifacts (container images, archives, binaries).
- Pipelines are defined with configuration files (
cloudbuild.yamlor JSON), letting you mix tools, languages, and commands.
Why use Cloud Build (benefits)
Now, the tradeoffs.

If you rely on very specialized or legacy build environments, evaluate whether those requirements can be containerized before committing to a fully managed solution.
- Connect the source repository (GitHub, GitLab, Cloud Source Repositories, etc.).
- Define a build configuration file (
cloudbuild.yamlor JSON) listing ordered build steps and images. - Create build triggers to run on commits, pull requests, or tags — or start builds manually.
- Cloud Build runs each step inside the specified container image (examples: install deps, run tests, build image).
- Store build outputs in Artifact Registry or Cloud Storage.
- Deploy artifacts to targets such as GKE, Cloud Run, or App Engine.
- Monitor build logs and status in the Cloud Console for troubleshooting and observability.

cloudbuild.yaml (minimal example)
This example shows a simple workflow: install dependencies, run tests, build a Docker image, and push it to Artifact Registry. Adjust images, steps, and substitutions for your project.
- Keep steps small and composable — each container should do one focused task.
- Use official builder images (
gcr.io/cloud-builders/*) or your own images for reproducibility. - Use substitutions (
_VAR) and built-in variables ($SHORT_SHA,$BRANCH_NAME) to parameterize builds. - Store secrets securely (Secret Manager + build substitutions) instead of embedding credentials in the config.
- Use the Cloud Console’s Build History and Logs to inspect step output and timings.
- Enable build notifications (Pub/Sub, Slack, or email) for CI feedback.
- Leverage build artifacts and logs retention policies for auditability.
cloudbuild.yaml patterns, build triggers, and deployments is covered later in the course.
See you in the next lesson.