You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Cloud Build triggers automate your CI/CD pipeline by starting builds in response to source code changes. When a developer pushes a commit, opens a pull request, or creates a tag, a trigger can automatically run your build pipeline — testing, building, and deploying your application without manual intervention.
A trigger is a Cloud Build configuration that watches a source repository for changes and starts a build when specific conditions are met. Triggers connect your source code to your build pipeline.
| Component | Description |
|---|---|
| Source | The repository to watch (GitHub, GitLab, Bitbucket, Cloud Source Repos) |
| Event | What triggers the build (push, pull request, tag) |
| Filter | Branch or tag patterns to match |
| Build config | The cloudbuild.yaml to execute (or inline steps) |
| Substitutions | Variables passed to the build |
| Service account | Identity used to run the build |
gcloud builds triggers create github \
--name="deploy-on-push" \
--repo-name=my-repo \
--repo-owner=my-org \
--branch-pattern="^main$" \
--build-config=cloudbuild.yaml \
--service-account=projects/my-project/serviceAccounts/cloud-build@my-project.iam.gserviceaccount.com
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.