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)
- Click Continue to Authenticate.
- 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
In Cloud Build → Go to Triggers → Create Trigger.
Fill in the fields:
Basic Settings
- Name: first-trigger
- Region: global
- Tags: dev_team
Event Type
- Event: Push to a branch
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)
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
Open your GitHub repository.
Make a small change (add a print statement, update a README, etc.).
Commit and push the changes.
This action will automatically trigger Cloud Build.
📊 Step 4: View Build History & Logs
Go to Cloud Build → History.
You’ll see your recent builds.
Click any build to open the Build Summary:
You can view:
- Build logs
- Execution details
- Artifact outputs
- Build duration & steps
📈 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
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)