DEV Community

Cover image for 🚀How to Create Your First GitHub Trigger & Connections in Google Cloud Build
Latchu@DevOps
Latchu@DevOps

Posted on

🚀How to Create Your First GitHub Trigger & Connections in Google Cloud Build

Google Cloud Build makes it incredibly simple to automate your CI/CD pipeline. One of the most common setups is connecting GitHub → Cloud Build so that every commit automatically triggers a build.
If you're new to Cloud Build, follow this step-by-step guide to create your first trigger successfully.


🔗 Step 1: Connect GitHub Repository to Cloud Build

  • Open Google Cloud Console → Search for Cloud Build.
  • Go to the Triggers section.
  • Click “Connect Repository”.
  • Select your source provider: → GitHub (Cloud Build GitHub App)

1

  • Click Continue to Authenticate.

2

  • You’ll be redirected to GitHub to install the Cloud Build GitHub App.
  • After installation, return to Cloud Build.
  • Select the GitHub account and repository you want to connect.
  • Click Connect → Done.

Your GitHub repo is now officially linked with Google Cloud Build.


⚙️ Step 2: Create Your First Cloud Build Trigger

  1. In Cloud Build → Go to Triggers → Create Trigger.

  2. Fill in the fields:

Basic Settings

  • Name: first-trigger
  • Region: global
  • Tags: dev_team

Event Type

  • Event: Push to a branch

3

Source Configuration

  • Source: Cloud Build Repositories
  • Repository type: 1st generation
  • Repository: Select your GitHub repo
  • Branch: ^main$ (This ensures the trigger runs only for main branch pushes)

4

Build Configuration

  • Configuration: Autodetected
  • Location: Repository (Cloud Build will search for your cloudbuild.yaml inside the repo)

Service Account

  • Select your Cloud Build service account
  • Click Create Trigger

Your first CI pipeline is now ready!


📝 Step 3: Commit Changes in GitHub

  1. Open your GitHub repository.

  2. Make a small change (add a print statement, update a README, etc.).

  3. Commit and push the changes.

This action will automatically trigger Cloud Build.


📊 Step 4: View Build History & Logs

5

  1. Go to Cloud Build → History.

  2. You’ll see your recent builds.

  3. Click any build to open the Build Summary:

You can view:

  • Build logs
  • Execution details
  • Artifact outputs
  • Build duration & steps

6

7


📈 Step 5: Monitor Overall Build Activity

Open the Cloud Build Dashboard to get a high-level view of:

  • Recent build status
  • Success/failure rate
  • Build durations
  • Trigger usage

8

This helps track the health of your CI pipeline easily.


🎉 Final Thoughts

You’ve now successfully set up:

✔ GitHub connected to Cloud Build
✔ A working build trigger
✔ Automated builds on every commit
✔ Build logs and dashboard monitoring


🌟 Thanks for reading! If this post added value, a like ❤️, follow, or share would encourage me to keep creating more content.


— Latchu | Senior DevOps & Cloud Engineer

☁️ AWS | GCP | ☸️ Kubernetes | 🔐 Security | ⚡ Automation
📌 Sharing hands-on guides, best practices & real-world cloud solutions

Top comments (0)