Watch paths
Deploy only when files matching your glob patterns change, for monorepos and apps with docs or assets in the same repository.
A push triggers a deployment only if it changes a file that matches one of your watch paths. Applications and Compose stacks both support them.
Before you start
- GitHub, GitLab, Bitbucket or Gitea as the source. With the Git source, the repository must be hosted on one of these.
- On GitHub, nothing else is needed. On the others, set up auto deploy first.
Add paths
The field takes a list of patterns, so you can watch several locations. For this layout:
my-app/
├── src/
│ └── index.js
└── public/| Pattern | Triggers when |
|---|---|
src/* | Any file in src/ changes |
src/index.js | That file changes |
Pattern syntax
| Feature | Example | Matches |
|---|---|---|
| Multiple globs | one pattern per entry | Any entry |
| Globstar | ** | Any number of directories |
| Wildcard | *.js | All JavaScript files |
| Negation | !a/*.js | Excludes JavaScript files in a |
| Negated name | *!(b).js | JavaScript files except those ending in b |
| Extglob | +(x|y), !(a|b) | x or y one or more times; anything but a or b |
| POSIX classes | [[:alpha:][:digit:]] | Any letter or number |
| Brace ranges | foo/{1..5}.md | foo/1.md to foo/5.md |
| Brace lists | bar/{a,b,c}.js | bar/a.js, bar/b.js, bar/c.js |
| Character classes | foo-[1-5].js | foo-1.js to foo-5.js |
| Alternation | foo/(abc|xyz).js | foo/abc.js or foo/xyz.js |
