Vibe Coding to Production
Deploying a Gemini App with Cloud Run and GitHub

Vibe coding apps is great for prototyping but this can leave you short of a robust developer workflow with an integrated CI/CD. The following post covers in detail how to set up a codebase with GitHub, integration with Google Cloud Build and deployment with Google Cloud Run.
Creating the app
For the example app, I will create a basic chat app (using Gemini CLI).
You can see above that we've used the prompt generate an attractive looking python webapp that is a gemini chatbot using the gemini 3 flash model to build it. It was sufficiently capable but also very simple and it worked out of the box!
Note that the app is using the latest google-genai package. Gemini 3 has a knowledge cutoff of January 2025 and hence doesn't default to this package. To equip Gemini 3 with the latest knowledge, check out a previous blog post on Upskilling Antigravity and Gemini CLI for the Gemini API.
Creating a GitHub repository
Next, I want to push the code to GitHub - I will use the GitHub CLI. The first step is to create a local git repo and commit the code. The next step is to push the code to GitHub in a new private repo called simplechat.
π Note: The app is only comprised of two files: app.py and requirements.txt.
Deploying to Cloud Run
Cloud Run is a fully managed serverless platform that allows you to run containerised applications that automatically scale from zero to thousands of instances, ensuring you only pay for the exact resources your code consumes while it's active.
Let's now configure deployment to Google Cloud Run. The steps are as follows:
[Screenshot 1] Navigate to https://console.cloud.google.com/run/overview
[Screenshot 1] Select "Connect Repository"
[Screenshot 2] On the next screen, select "GitHub." Continuously deploy from a repository (source or function).
[Screenshot 2] Also select "Cloud Build".
[Screenshot 3] Click "Set up Cloud Build". This will expand a panel on the right-hand side of the window, where you can authenticate your GitHub account and connect your repository. Once you have done so, you will be on the third image below (bottom right).
[Screenshot 3] Give your Cloud Run service a name and region. I chose
simplechatfor the name andus-central1. For authentication, select "Allow public access" and click "Create".[Screenshot 4] Under the "Creating service" section, you can see the status of creating the service, creating the build trigger, building and deploying from the repository. At the end of this, you'll have a URL to access the Cloud Run service.
π I'd said earlier that the app is only two files app.py and requirements.txt. The neat thing about deploying through Cloud Run is that it uses Buildpacks. Because of Buildpacks, we don't even need to write a Dockerfile; it inspects the code, detects Python, and containerises it automatically.
Configuring API keys securely
After deploying the app, there's an error! The API key is missing.
To fix this, the Cloud Run deployment needs to be edited to declare the GEMINI_API_KEY environment variable.
The steps to do this are:
[Screenshot 1] On the Cloud Run deployment page, click "Edit and Deploy New Revision".
[Screenshot 2] Select "Variables & Secrets" and click "Add variable".
[Screenshot 3] Call the variable "GEMINI_API_KEY" and fill in its value. Click "Deploy".
This will deploy a new revision of the app (using the previously built container image), where the environment variable will be accessible.
π We just injected our GEMINI_API_KEY as a plaintext environment variable. This is fine for our simple chat app, but as your app grows, you'll want to lock this down. The industry-standard next step is to use Google Cloud Secret Manager. You can store the key there and configure Cloud Run to pull it securely at runtime, ensuring your secrets are properly encrypted and access-controlled.
Confirm that changing source code deploys automatically to Cloud Run
Now I will update the heading to force a source code change, push to GitHub and observe the automated Cloud Run deployment. The source code change is:
Pushing this code will immediately trigger a Cloud Build.
Once this is finished, the updated app is instantly available on Cloud Run.
In this blog post, I created a simple Gemini chat app using Gemini CLI. I pushed the repository to GitHub, configured a new Cloud Run service that connects to the GitHub repo, added my secrets (through environment variables) and demonstrated the automated deployments through code pushes. I now have a production ready setup. As the app grows, this setup will allow me to quickly iterate.



