Path Filtering and Selective Builds
Trigger only the workflows and jobs affected by a change using path filters, change detection, and conditional matrices in monorepos and multi-repo setups.
The Wasted Build Problem
In a monorepo, a change to the documentation should not rebuild and redeploy the backend, the frontend, and the mobile app.
Selective builds run only the parts of the pipeline affected by a change, saving time and runner minutes.
Path Filters on Triggers
The simplest approach is the paths filter on the trigger. A workflow only runs when files matching the pattern change.
on:
push:
paths:
- 'services/api/**'All lessons in this course
- CI/CD for Monorepos
- Cross-Repository Workflows
- Centralized Workflow Management
- Path Filtering and Selective Builds