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)