Repository navigation
Preview deployments and watchPaths in monorepos #5547
|
Hi! I'm using Dokploy with a monorepo containing multiple applications, each with its own watchPaths. For example: frontend:
watchPaths:
- apps/frontend/**backend:
watchPaths:
- apps/backend/**When I open a PR that only changes files under apps/backend/**, Dokploy still creates a preview deployment for the frontend application. Are watchPaths currently expected to be ignored for Preview Deployments? If so, is there a recommended way to prevent previews from being created for applications that were not affected by the PR? Thanks! |
Replies: 1 comment
Yes,
|
Yes,
watchPathsis currently only evaluated forpusheventsIn Dokploy's GitHub webhook handler (
apps/dokploy/pages/api/deploy/github.ts),watchPathsfiltering is implemented viashouldDeploy(app.watchPaths, normalizedCommits).However, this check is only called in the
pushevent block (lines ~130–165). In thepull_requestevent block (lines ~200–320), Dokploy creates preview deployments for all applications matching the target base branch without evaluatingwatchPaths, because GitHub'spull_requestwebhook payload does not include the per-commit modified files array.Recommended Solution: Use Dokploy's "Preview Labels"
Dokploy natively supports filtering preview deployments by PR labels (
…