Continuous integration and deployment (CI/CD) streamline the application development process, making it more efficient and less error-prone. Integrating platforms like with GCP's Container Registry can simplify and automate container deployment, saving time and resources. In this article, we'll walk you through the process of deploying a container to GCP's Container Registry using


Set Up Google Cloud Service Account

Create a service account on GCP to give access:

  • Go to GCP console > IAM & admin > Service accounts.
  • Click Create Service Account
  • Assign the Storage Admin role to the service account. This will allow to push images to the Container Registry.
  • Download the JSON key for your service account, which you will use later.

Configure and Set up GCP Workflows

Before we get started with this guide, install the GCP GKE Pulumi Py workflow from. If you don't have access to the repository, kindly contact us at [email protected] The repo includes a complete IaC for deploying infrastructure over GCP: Kubernetes, Container Registry, Database Clusters, Load Balancers, and Project Resource Management, all built using Python + Pulumi +

Clone the repository with:

git clone “” 

cd gcp-gke-pulumi-py

Run and Set up your Infrastructure

Next, you need to build and set up the infrastructure that will deploy each resource to GCP using the GCP workflow stack. Set up your infrastructure using the ops run -b . This will provision your stack and set up your infrastructure.

  • Select setup infrastructure over GCP
  • This process will build your Docker image and start provisioning your GCP infra resources.
  • Next, select the services you want to deploy from the CLI. We will select the all service and install all the dependencies, which will also provision our GCP container registry.
  • Back in the GCP console, click on your container registry, and you will see your Container Registry created for usage.

Create and Update Ops.yml file

Next, create your ops.yml file with the updated changes to push your resources to GCP Container Registry.

version: "1"
  - name: sample-expressjs-pipeline-gcp-gke-pulumi-pyf:0.1.1
    description: Build and Publish an image in a GCPContainer Registry
        - DEBIAN_FRONTEND=noninteractive
        - STACK_TYPE=gcp-gke-pulumi-py
        - ORG=cto-ai
        - GH_ORG=workflows-sh
        - REPO=sample-expressjs-gcp-gke-pulumi-py
        - BIN_LOCATION=/tmp/tools
        - GITHUB_TOKEN
        - PULUMI_TOKEN
      - "github:workflows-sh/sample-gcp-gke-pulumi-py:pull_request.opened"
      - "github:workflows-sh/sample-gcp-gke-pulumi-py:pull_request.synchronize"
      - "github:workflows-sh/sample-gcp-gke-pulumi-py:pull_request.merged"
      - name: sample-expressjs-build-gcp-gke-pulumi-py
        description: Build step for sample-expressjs-gcp-gke-pulumi-py
          - git
          - unzip
          - wget
          - tar
          - mkdir -p $BIN_LOCATION
          - export PATH=$PATH:$BIN_LOCATION
          - ls -asl $BIN_LOCATION

  - name: build docker image
      - docker build -t$GOOGLE_PROJECT_ID/my-image:$CTO_SHA1
  - name: Push to GCP container Registry
      - echo $GCLOUD_SERVICE_KEY | gcloud auth activate-service-account --key-file=-
      - gcloud --quiet auth configure-docker
      - docker push$GOOGLE_PROJECT_ID/my-image:$CTO_SHA1

Run the Pipeline

After updating the ops.yml file, push it to your repository. This should trigger a build. will build your Docker image and push it to GCP’s Container Registry.

Verify Deployment to GCP

Once your pipeline completes:

  • Go to the GCP Console
  • Navigate to Container Registry, and click on Images.
  • You should see your Docker image listed there, confirming a successful deployment.


Integrating with GCP’s Container Registry provides a powerful way to automate container deployment. With a few configuration steps, you can set up a CI/CD pipeline, ensuring your applications are built, tested, and deployed efficiently. This approach allows developers to focus on coding while and GCP handle the deployment processes.