Google Cloud Tutorial · Operations · Lesson 24 of 27

Cloud Build, Artifact Registry and Cloud Deploy

Building and shipping software on Google Cloud: Cloud Build pipelines, images in Artifact Registry, and promotions with Cloud Deploy.

Members can save this page, take notes and track progress. See membership · Sign in

Build

Cloud Build runs steps in containers from a cloudbuild.yaml, triggered by commits in GitHub, GitLab or Bitbucket:

steps:
  - name: python:3.13
    entrypoint: bash
    args: ["-c", "pip install -r requirements.txt && pytest"]
  - name: gcr.io/cloud-builders/docker
    args: ["build", "-t", "europe-west1-docker.pkg.dev/$PROJECT_ID/apps/orders-api:$SHORT_SHA", "."]
images: ["europe-west1-docker.pkg.dev/$PROJECT_ID/apps/orders-api:$SHORT_SHA"]

Store

Artifact Registry stores container images and language packages (npm, Maven, Python), with vulnerability scanning and cleanup policies. It replaced Container Registry, which is retired.

Deploy

Cloud Deploy promotes one release through targets (dev → staging → prod) for GKE or Cloud Run, with approvals, canary steps and rollback. Binary Authorization can require images to be signed or attested before they run.

You can also use GitHub Actions or GitLab CI with Workload Identity Federation: no keys stored in the CI system.

Promoting the same release through targetsTry it yourself
release = "orders-api@3f2c9e1"
pipeline = [("dev", False), ("staging", False), ("prod", True)]      # (target, needs approval)
approvals = {"prod": "alice (release manager)"}
for target, needs_approval in pipeline:
    if needs_approval and target not in approvals:
        print(f"{release} waiting for approval to {target}")
        break
    who = f", approved by {approvals[target]}" if needs_approval else ""
    print(f"{release} deployed to {target}{who}")

Output

orders-api@3f2c9e1 deployed to dev
orders-api@3f2c9e1 deployed to staging
orders-api@3f2c9e1 deployed to prod, approved by alice (release manager)

Test yourself

Where should container images for Cloud Run and GKE be stored today?

  1. Container Registry
  2. Artifact Registry
  3. Cloud Storage
  4. Filestore
Show answer

Answer: Artifact Registry

Artifact Registry is the current registry; Container Registry is retired.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake