Automating Go App Deployment to Google Cloud Run with GitHub Actions(Free Tier)

Published: (December 19, 2025 at 07:40 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Cover image for Automating Go App Deployment to Google Cloud Run with GitHub Actions (Free Tier)

Hi, everyone! This is my first article on dev.to.👋

I recently built a Go application and deployed it using Google Cloud Run and GitHub Actions to deepen my DevOps skills. In this post, I’ll share how I automated the deployment process and what I learned along the way.

Background

I currently live in Canada but earn my salary in JPY. Since the exchange rate fluctuates constantly, checking the CAD/JPY rate manually every day has been a hassle. I wanted a system that would automatically notify me via Slack whenever the rate improved compared to the day before. To achieve this, I decided to automate the workflow using GCP and GitHub Actions.

The System Architecture

graph LR
  GitHub[GitHub] --> Actions[GitHub Actions]
  Actions --> Registry[Artifact Registry]
  Registry --> CloudRun[Cloud Run]
  Scheduler[Cloud Scheduler] --> CloudRun

Why These Technologies?

  • Why Go?
    It’s a statically typed language, which ensures robustness and keeps the container image size small.

  • Why Google Cloud Run?
    It’s a serverless platform, so I don’t need to manage servers. Plus, it scales to zero when not in use, allowing me to run this bot within the Free Tier.

  • Why GitHub Actions?
    It lets me manage the CI/CD pipeline right next to my code. Integrating it with GCP is secure and seamless.

Key Challenges & Solutions

  • The “Secure by Default” Trap (403 Forbidden)
    Google Cloud Run blocks unauthenticated access by default. I resolved the 403 Forbidden errors by setting an OIDC token in the Cloud Scheduler authentication header.

  • CI/CD Configuration Details
    I spent time debugging the GitHub Actions pipeline because of a mismatch in the Artifact Registry configuration. I had confused the repository name with the repository ID. This taught me that in DevOps, paying attention to the smallest details in variable names is just as important as writing the code itself.

What I Learned

The trade‑off between initial setup pain and future efficiency became clear. Running code locally is intuitive and instant, while moving to the cloud felt tedious. Once I overcame that barrier, the power of automation became evident. The system now works for me while I sleep, illustrating that engineering is about enduring the initial struggle of setup to achieve long‑term efficiency.

Future Improvements

  • Database Integration: Add PostgreSQL (with Atlas) to store historical rate data.
  • Data Analysis: Build a Python component to analyze rate trends using Pandas and visualize the data.
  • GitHub Repository:
Back to Blog

Related posts

Read more »