> Canonical URL: https://codingcat.dev/post/google-cloud-repositories-ci-cd

# Google Cloud Repositories CI/CD

✏️ Blog PostMay 16, 2022[![](/logos/firebase/firebase-symbol.png)![](/logos/firebase/firebase-symbol.png)Firebase](/topic/firebase)[![](/logos/tags/google-cloud-symbol-light.svg)![](/logos/tags/google-cloud-symbol-dark.svg)Google Cloud](/topic/google-cloud)[#DevOps](/topic/devops)[![](/logos/tags/github-symbol-light.svg)![](/logos/tags/github-symbol-dark.svg)GitHub](/topic/github)[![](/logos/tags/docker-symbol-light.svg)![](/logos/tags/docker-symbol-dark.svg)Docker](/topic/docker)[![](/logos/tags/nextjs-symbol-light.svg)![](/logos/tags/nextjs-symbol-dark.svg)Next.js](/topic/nextjs)[![](/logos/tags/html-symbol-light.svg)![](/logos/tags/html-symbol-dark.svg)HTML](/topic/html)

# Google Cloud Repositories CI/CD

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/80a3eb15d10366ed52ae81fa950b2b83a4079bdd-1280x720.png?w=1920&h=1080&q=82&fit=max&auto=format)[@CodingCatDev62.5K / 100K Subscribers Goal](https://www.youtube.com/@codingcatdev?sub_confirmation=1)[Subscribe on YouTube→](https://www.youtube.com/@codingcatdev?sub_confirmation=1)[Watch on YouTube App ↗](https://www.youtube.com/watch?v=MijHRE5h6Gg&list=UUnKZ8gEb78zXKMi1ns-IQ2g)[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)

We will continue our hello world example from [Firebase Project Hosting](/post/firebase-multisite-hosting) and extend this into publishing our site to firebase using CI/CD. The final hosting example will create the site in the initial project folder (in my case ajonp-lesson-1)

- Source Code Repositories Pricing
- Create Github Repository
- Create Google Cloud Source Repository
- Create Dockerfile for uploading to Firebase
- Create cloudbuil.yaml for Google Cloud Build to trigger build
- Setup Triggers
- Commit to cause a trigger to run
- Update content to change Hello World

# Why do I use Google Source Repositories?

> Because it is cheaper! (and I develop on a shoestring budget) The negative is that it is not as straight forward to use as git clone

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/929a9a52ee2df316c470e821f4d2cdc7fb3dc897-383x383.png?w=383&q=82&fit=max&auto=format)

## Github

Don't get me wrong I think that $7 a month is a great deal, but you have to pay it the minute you want to start using private repos.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/95ef41fca3ca2eab41f1c76029b103c7b0e1a52b-1031x887.png?w=1031&q=82&fit=max&auto=format)![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/3fa8204f59b46f203ad0b8e5889d8ae420643996-256x256.png?w=256&q=82&fit=max&auto=format)

## Google Cloud Source Repositories

Basically free until you scall to a large level.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/0a3e5e20c49c0b33ae3a62cbd1c892e3eb94f763-780x662.png?w=780&q=82&fit=max&auto=format)

## Create Repository

Select new

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/51358aa222faaad5c087743d79c84da28f31fecf-1196x323.png?w=1196&q=82&fit=max&auto=format)

Create name for repo

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/fc390a1dec743ace51b11fac12c59ed86e49dd01-1248x775.png?w=1248&q=82&fit=max&auto=format)

Clone our existing "Hello World" project

Copied! 🐾

```
git clone https://github.com/AJONPLLC/lesson-1-firebase-project.git cd lesson-1-firebase-project/
```

## Remove remote references

When you are cloning an existing repository you need to cleanup the remote reference to store this into a new repository.

Lets look at the remotes currently

This should show something like

Copied! 🐾

```
origin [https://github.com/AJONPLLC/lesson-1-firebase-project.git](https://github.com/AJONPLLC/lesson-1-firebase-project.git) (fetch)
origin [https://github.com/AJONPLLC/lesson-1-firebase-project.git](https://github.com/AJONPLLC/lesson-1-firebase-project.git) (push)
```

Let's remove this remote

Copied! 🐾

```
git remote rm origin
```

## Add Newly created repo

Copied! 🐾

```
git remote add origin https://github.com/AJONPLLC/lesson-2-firebase-ci.git git push -u origin master
```

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/8b359a666ec48496a64955ff2db0910900e7c246-3315x3067.png?w=1600&q=82&fit=max&auto=format)

# Google Cloud

> As of right now December 3, 2018 Google has this message: This version of Cloud Source Repositories will permanently redirect to the new version of Cloud Source Repositories starting December 3rd. Try the new version today for fast code search, an improved code browser, and much more.

## Google Cloud Source Repositories

Open [Source Cloud Repositories](https://source.cloud.google.com/). Now you can select "Add repository".

### Add Google Cloud Repository (standalone)

Select "Create new repository" option.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/dbb1ad362bb2a521b397faefa2f6c6d52e8f3b3a-618x290.png?w=618&q=82&fit=max&auto=format)

From the first lesson you should have a project that was created from firebase, you can use the dropdown under "Project" to select. Then Click "Create" (Not Create Project, unless you want this to be seperated).

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/7dc1516e8f5fa7281dbd908be438bde253704a7e-795x371.png?w=795&q=82&fit=max&auto=format)

### Add Code to Google Cloud Repository

Typically on a fresh repo you would now clone this and start working.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/b2d63d590852d2871f605a17c5b4cb8a8a0aad34-816x825.png?w=816&q=82&fit=max&auto=format)

For this example we are going to select "Push code from a local Git repository" because we have an example we are already working with.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/307fcf1a7dcdaef16411b042930cb29faaabb2ac-815x732.png?w=815&q=82&fit=max&auto=format)

You can skip the first command (unless you skipped both the Lesson 1 and hosting in GitHub).

First verify that we have the correct origin for your project (mine should be lesson-2 not lesson-1)

> origin https://github.com/AJONPLLC/lesson-2-firebase-ci.git (fetch) origin https://github.com/AJONPLLC/lesson-2-firebase-ci.git (push)

Now add Google Source Repository as an additional remote location

Copied! 🐾

```
git remote add google https://source.developers.google.com/p/ajonp-ajonp-com/r/ajonp-lesson-2
```

Look at your remotes once again and you should see two.

> google https://source.developers.google.com/p/ajonp-ajonp-com/r/ajonp-lesson-2 (fetch) google https://source.developers.google.com/p/ajonp-ajonp-com/r/ajonp-lesson-2 (push) origin https://github.com/AJONPLLC/lesson-2-firebase-ci.git (fetch) origin https://github.com/AJONPLLC/lesson-2-firebase-ci.git (push)

Helpful hint for multiple remotes in VSCode, you can access the git tab, then "...", then "Push to...". This will show you the remotes.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/867cb676ef71965024b01d49224a64eec990db3f-604x194.jpg?w=604&q=82&fit=max&auto=format)

To remove your GitHub based remote you can execute, however we will not do this now as we want to test pushing code to both repositories.

Copied! 🐾

```
git remote remove origin
```

## Create Dockerfile

I like to create a folder for all of my dockerfiles, this allows you to easily locate and access them all. There are many references in the [Official Guide](https://cloud.google.com/cloud-build/docs/configuring-builds/build-test-deploy-artifacts#deploying_artifacts), but they always seem to place this file alongside your cloudbuild.yaml file (in my opinion this confuses things).

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/061d73ff7dace8e783bc973a1d4c38359f3c4f71-366x123.png?w=366&q=82&fit=max&auto=format)

This Dockerfile is utilizing a prebuilt node image from node. dockerfiles/firebase/Dockerfile

We need to make sure that billing and the cloud build API are setup. You can follow a great guide [Enable Billing](https://cloud.google.com/cloud-build/docs/quickstart-docker).

Again we are doing this on the cheap, other places will charge you a monthly fee for this. Google allows for 120 build minutes a day!!

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/07f694b084b2b4bc174afdf40bb45d0fad60f929-892x578.png?w=892&q=82&fit=max&auto=format)

## Create Cloudbuild

This cloudbuild.yaml file will leverage the gcloud trigger. [https://cloud.google.com/cloud-build/docs/cloud-builders](https://cloud.google.com/cloud-build/docs/cloud-builders)

cloudbuild.yaml (place in root directory)

Copied! 🐾

```
steps:
# Build the firebase image
- name: 'gcr.io/cloud-builders/docker' args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/firebase', './dockerfiles/firebase' ]
# Deploy to firebase
- name: 'gcr.io/$PROJECT_ID/firebase' args: ['deploy', '--token', '${_FIREBASE_TOKEN}']
# Optionally you can keep the build images
# images: ['gcr.io/$PROJECT_ID/hugo', 'gcr.io/$PROJECT_ID/firebase']
```

> You may have noticed an interesting line here, this allows for an argument called `_FIREBASE_TOKEN` to be setup in our cloud deploy, so it doesn't leak out in our GitHub/GCP Repositories. `args: ['deploy', '--token', '${_FIREBASE_TOKEN}']`

We will need a token from firebase for this next Patterson

This will walk you through the process (same as login before). When this finishes back in the terminal you should receive a token like `1/8V_izvEco3KY8EXAMPLEONLYpnLGpGLPAvofC_0YX3qx2NE_Zxs Along with a message Example: firebase deploy --token "$FIREBASE_TOKEN"`

You will need to capture this token, or leave your terminal open for setting up a trigger.

## Setup trigger

Go back to Google Cloud Platform [Console](https://console.cloud.google.com/home/dashboard). Using the hamburger navigation Cloud Build > [Triggers](https://console.cloud.google.com/cloud-build/triggers).

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/73726948eba81c27827621c0d7acce114e63f1ec-432x158.png?w=432&q=82&fit=max&auto=format)

### Github Trigger

Select Github as source, then authenticate.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/c7f655cb3edc140558942df9d48041a6b253af3e-653x308.png?w=653&q=82&fit=max&auto=format)

Select Repository

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/58940d88f48ecc669046002c4c3c413aa8413b21-630x690.png?w=630&q=82&fit=max&auto=format)

Setup Trigger Settings

> Pay close attention to add the Firebase Token from the steps above.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/b38aae9dffc5fc7e93205e5d336911f6b5f4ec60-613x843.png?w=613&q=82&fit=max&auto=format)

### GitHub Commit for trigger

Now you can run the commands to add the changes dockerfile and cloudbuild.yaml

Now remember we have commited these changes locally, we still need to push them to origin (which is our GitHub remote)

You can now check that your trigger didn't fail by going to [Google Cloud Platform - Cloud Build History](https://console.cloud.google.com/cloud-build/builds)

### Google Source Repository Trigger

This will be the identical setup.

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a36b00c29c992e0b0a7d9d1873787ce57106f728-484x298.png?w=484&q=82&fit=max&auto=format)![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/16ef49906cea271dc88dbf32613589c45c4decaa-466x316.png?w=466&q=82&fit=max&auto=format)

Now we just need to push to a different remote (Google Cloud Repository)

# Update Content - see CI/CD in Action

Update your index file to show something changed.

public/index.html

Copied! 🐾

```

		Welcome to Firebase Hosting

		Firebase is not building everytime I commit, just from following[Google Cloud Repositories CI/CD
		![Hero Image](https://cdn.sanity.io/images/hfh83o0w/dev/ff5819091dc1986c997b7c63c0341a47027518b8-1280x720.webp)

```

Add, commit, push filesCopied! 🐾

```
git add . git commit -m "CI/CD" git push --set-upstream google master
```

## Resources, Links & Official Documentation

**Watch on YouTube: ** Google Cloud Repositories CI/CD Full Video](https://ajonp.com/lessons/2-firebase-ci/) (plus [Subscribe to CodingCat.dev](https://www.youtube.com/@CodingCatDev?sub_confirmation=1))
- **UPDATE: GitHub now offer unlimited private repos: ** [https://github.blog/2019-01-07-new-year-new-github/](https://github.blog/2019-01-07-new-year-new-github/)
- **🎥 YouTube: ** [https://link.ajonp.com/youtube](https://link.ajonp.com/youtube)
- **🌎 Site: ** [https://link.ajonp.com/😺](https://link.ajonp.com/😺)
- **📦 GitHub: ** [https://link.ajonp.com/github](https://link.ajonp.com/github)
- **🎓Lessons: ** [https://link.ajonp.com/lessons](https://link.ajonp.com/lessons)
- **🗞AJ’s Week in Web: ** [https://link.ajonp.com/week-in-web](https://link.ajonp.com/week-in-web)
- **💬 Slack: ** [https://link.ajonp.com/slack](https://link.ajonp.com/slack)
- **🐦 Twitter: ** [https://link.ajonp.com/twitter](https://link.ajonp.com/twitter)
- **💬 Slack: ** [https://bit.ly/ajonp-slack-invite](https://bit.ly/ajonp-slack-invite)
- **🐦 Twitter: ** [https://bit.ly/ajonp-twitter](https://bit.ly/ajonp-twitter)
- [**Google Cloud Architecture & Docs:**](https://cloud.google.com/docs) Cloud Run, Kubernetes Engine, BigQuery, and Vertex AI guides
- [**Firebase Documentation:**](https://firebase.google.com/docs) Firestore, Data Connect, Authentication, App Check, and Cloud Functions
- [**GitHub Actions CI/CD Documentation:**](https://docs.github.com/en/actions) Automated deployment pipelines, secrets management, and runners

## Related CodingCat.dev Tutorials & Podcast Episodes

- [**Google Cloud Reference**](/post/google-cloud-reference): A developers cheat sheet for all the products offered by Google Cloud Platform
- [**Firebase Multisite Hosting**](/post/firebase-multisite-hosting): Creation of multiple sites within Hugo (main and amp), as well as multiple sites written in Angular (admin and app).
- [**Next.js Deployment Adapters: A bright future for Next.js on Google Cloud in Firebase: Web Architecture & Implementation Guide**](/post/firebase-2026-03-nextjs-adapters): Hands-on web engineering breakdown of "Next.js Deployment Adapters: A bright future for Next.js on Google Cloud" (2026-03-26). Learn how to integrate Firebase, ...

## Frequently Asked Questions (FAQ)

### What are the main takeaways from Google Cloud Repositories CI/CD?

Google Cloud Continuous Integration and Delivery (CI/CD). Firebase CI/CD Using Google Cloud Build: UPDATE: GitHub now offer unlimited private repos https://github.blog/2019-01-07-new-year-new-github/ 🎓 Lesson: https://ajonp.com/lessons/2-firebase-ci/ 1. Source Code Repositories Pricing
2. Create Github Repository
3. Create Google Cloud Source Repository
4. Create Dockerfile for uploading to Fi, I'll look it up is by far the most used get a repo author it's definitely not the cheapest when you're talking about private storage when you have a lot of projects that you're doing and you don't want to share it publicly I believe that Google's source repository is probably the cheapest option out luckily with Google cloud platform we really don't have to choose we can pick either get up or the... Throughout this post, Alex Patterson breaks down real-world implementation details for Google Cloud, Firebase, DevOps so developers can apply these patterns directly in production.

### How do you implement Google Cloud best practices in production?

When adopting Google Cloud and Firebase in a production stack, start by validating your configuration against the [**Google Cloud Architecture & Docs**](https://cloud.google.com/docs) (Cloud Run, Kubernetes Engine, BigQuery, and Vertex AI guides). Focus on incremental adoption, automated testing, and observability so your team can measure performance and developer velocity improvements at each stage.

### Where can I watch the full Google Cloud Repositories CI/CD walkthrough and find related code resources?

You can watch the complete video session for [**Google Cloud Repositories CI/CD**](https://www.youtube.com/watch?v=MijHRE5h6Gg) on the [**CodingCat.dev YouTube channel**](https://www.youtube.com/@CodingCatDev?sub_confirmation=1). For a deeper dive into Google Cloud, check out our related guide: [**Google Cloud Reference**](/post/google-cloud-reference).

## ✏️ Video Summary

Firebase CI/CD Using Google Cloud Build: UPDATE: GitHub now offer unlimited private repos https://github.blog/2019-01-07-new-year-new-github/

🎓 Lesson: https://ajonp.com/lessons/2-firebase-ci/

1. Source Code Repositories Pricing
2. Create Github Repository
3. Create Google Cloud Source Repository
4. Create Dockerfile for uploading to Fi — I'll look it up is by far the most used get a repo author it's definitely not the cheapest when you're talking about private storage when you have a lot of projects that you're doing and you don't want to share it publicly I believe that Google's source repository is probably the cheapest option out luckily with Google cloud platform we really don't have to choose we can pick either get up or the...

✏️ Visual Architecture Diagram

## how this post connects together.

Follow AJ through the pipeline topology from input contract to production output.

Let’s build it!✏️ Architecture Diagram: Google Cloud Repositories CI/CDDATAFLOW PIPELINEARCHITECTURE DIAGRAM[Diagram Walkthrough]Content-driven pipeline diagram for Google Cloud Repositories CI/CD: Google Cloud Repositorie -> System Implementation -> Edge Delivery & Telemetry.AAA Contrast Verified

## related deep dives.

[All Blog Posts&rarr;](/blog)[![Dockerless Serverless GPUs: How I Built a Fast, Cheap AI SaaS with RunPod Flash](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/78383c8986667bc1eaa504786488d88f212929a8-1280x720.jpg?w=1280&q=82&fit=max&auto=format)](/post/dockerless-serverless-gpus-fast-cheap-ai-saas-with-runpod-flash)October 6, 2026[#Serverless](/topic/serverless)[![](/logos/tags/cloudflare-symbol-light.svg)![](/logos/tags/cloudflare-symbol-dark.svg)Cloudflare](/topic/cloudflare)[![](/logos/tags/python-symbol-light.svg)![](/logos/tags/python-symbol-dark.svg)Python](/topic/python)[+5](/post/dockerless-serverless-gpus-fast-cheap-ai-saas-with-runpod-flash)

### [Dockerless Serverless GPUs: How I Built a Fast, Cheap AI SaaS with RunPod Flash](/post/dockerless-serverless-gpus-fast-cheap-ai-saas-with-runpod-flash)

Hosted image APIs cost 3 to 4 cents per generation. Using RunPod Flash for dockerless serverless GPUs, FlashFun.dev drops that to a fraction of a cent, turning $1 into 500 to 3,000 images. Here is the full architecture, the benchmarks, and the code.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)[![The Odin Project 2: Git & GitHub Engineering Workflows](https://cdn.sanity.io/images/hfh83o0w/production/ed2ced73d28d9e429e04e23b418bb53abf123d90-1376x768.png?w=1376&q=82&fit=max&auto=format)](/course/odin-git-and-github-workflows)November 4, 2026[![](/logos/tags/git-symbol-light.svg)![](/logos/tags/git-symbol-dark.svg)Git](/topic/git)[![](/logos/tags/github-symbol-light.svg)![](/logos/tags/github-symbol-dark.svg)GitHub](/topic/github)[#DevOps](/topic/devops)[+1](/course/odin-git-and-github-workflows)

### [The Odin Project 2: Git & GitHub Engineering Workflows](/course/odin-git-and-github-workflows)

Understand how Git actually stores snapshots, master branching and interactive rebase, write atomic commits, and automate PR checks with GitHub Actions.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)