<!--
title: Precise workflow triggers
domain: ml-systems
topic: CI/CD
language: Yaml
source: kubeflow/kubeflow
updated: 2022-12-20
url: https://awesomereviewers.com/reviewers/kubeflow-precise-workflow-triggers/
-->

Configure CI/CD workflows to trigger precisely based on relevant file path changes. This minimizes unnecessary builds and tests while ensuring all required workflows run when dependencies are modified.

**For component-specific workflows:**
- Include both direct component paths and shared dependencies
- For web applications, include common library paths

```yaml
# Example for a web application workflow
name: Build & Publish JWA Docker image
on:
  push:
    branches:
      - master
      - v*-branch
    paths:
      - components/crud-web-apps/jupyter/**      # Component code
      - components/crud-web-apps/common/**       # Shared dependencies
```

**For manifest-related workflows:**
- Target only specific manifest directories rather than all component files

```yaml
# For manifest testing, specify manifest paths only
name: Build Profile Controller manifests
on:
  pull_request:
    paths:
      - components/profile-controller/config/**  # Only manifest changes
```

Centralize build logic in Makefiles instead of duplicating in GitHub Actions. This allows workflows to simply call make targets, making pipelines more maintainable and consistent across environments.
