Monorepo Deploys on Raseef: Watch Paths for Shared Packages
Configure Raseef monorepo watch paths for shared packages and lockfiles, validate automatic deploys with a staging test matrix, and troubleshoot missed builds.
Why did the shared-package change never reach your app?
Your repository contains a web app, an API and a shared package. A push changes the shared package, but neither service rebuilds. Before blaming a cache, check the service's watch paths: the files that make a push eligible to trigger a build.
On Raseef, an empty watch-path configuration defaults to the service's root directory and its Dockerfile if that file is outside the directory. That is convenient for independent apps. It does not establish that every shared dependency outside the app folder is covered.
This guide is for teams deploying multiple services from one GitHub repository. It separates documented platform behavior from a proposed staging test. The settings were checked against the current official documentation on 3 December 2026; the acceptance test below was not executed in a Raseef workspace for this article. The cover is a generated illustration, not platform evidence.
Separate three decisions before changing settings
Root directory identifies the app folder, such as apps/web. Dockerfile path selects a build recipe and is relative to the repository root. Watch paths decide whether changed files in a push should trigger that service.
A correct trigger does not guarantee a correct build. Adding packages/shared/** to watch paths does not install a workspace dependency, change a build command or make a Docker COPY succeed. Conversely, a working manual build does not prove that automatic pushes are configured correctly.
Raseef first uses an explicitly configured Dockerfile path, then a Dockerfile in the root directory, and otherwise automatic detection. The build documentation does not establish every cross-directory build-context scenario. Validate your actual workspace installation and Dockerfile in a staging build rather than assuming a context boundary.
Map build inputs, not just app folders
Consider this example repository:
apps/
web/
api/
packages/
shared/
package.json
pnpm-lock.yaml
pnpm-workspace.yaml
tsconfig.base.json
docker/
web.Dockerfile
docs/Assume both apps import packages/shared, use the root pnpm workspace and inherit tsconfig.base.json. These are example dependencies, not a claim that all monorepos use this layout.
For the web service, a conservative explicit watch-path list is:
apps/web/**
packages/shared/**
package.json
pnpm-lock.yaml
pnpm-workspace.yaml
tsconfig.base.json
docker/web.DockerfileFor the API, start from the same list, replace apps/web/** with apps/api/**, and replace or remove the Dockerfile entry according to the API's real build recipe. Include additional shared packages and build scripts if the application consumes them.
Write the full intended list when choosing custom patterns; do not rely on empty-field defaults to fill omissions. Raseef documents one gitignore-like pattern per line, relative to the repository root, with up to 20 patterns. The web root being apps/web does not make src/** equivalent to apps/web/src/**.
A root lockfile can affect more than one workspace member, so rebuilding both services on its change is a conservative correctness choice. If the input graph is uncertain, start broad and narrow it only after acceptance tests. Do not omit dependencies merely to reduce build counts.
Be careful with Markdown exclusions
The documentation gives !**/*.md as an exclusion example. Use it only if Markdown is not a build input. A documentation site, content-driven app or generated help page may compile Markdown into the deployed output. Excluding those files can leave published content stale.
Watch paths are a trigger filter, not an access-control boundary or a secret filter. They do not make committed credentials safe.
Configure Raseef in an order that survives saving
- Open the service's Builds source settings and confirm repository, branch, root directory and Dockerfile path.
- Save any required source changes first. Saving repository, branch, root directory or Dockerfile path turns automatic deployment off again.
- Configure the intended watch paths and check Deploy automatically on every push after your final source-settings save. It is off for a new service.
- Use Deploy latest commit for a baseline build, then inspect the build and deployment separately.
- Confirm that the service is serving the expected version before testing subsequent pushes.
Raseef can discover apps up to three folders deep and workspace members with a start script or Dockerfile, showing up to 20 apps for selection. Discovery is useful setup assistance, not proof that each service watches every transitive dependency. For account connection and initial setup, see deploying a GitHub app on Raseef.
A reproducible staging acceptance test
Use a disposable branch and staging services, not a production branch. Ensure both services build successfully first. Prepare small, valid changes to existing tracked files; do not break dependency manifests or lockfiles just to generate a diff.
Make one change category per commit and one push at a time. Record the full commit SHA, changed paths, automatic-deploy setting, watch patterns, build outcome and serving revision. Wait for each observation before pushing again.
To inspect the paths changed between two known commits locally:
BEFORE=replace_with_previous_commit_sha
AFTER=replace_with_test_commit_sha
git diff --name-only "$BEFORE" "$AFTER" --Replace both placeholders with real SHAs available locally. This command compares two trees; it does not query Raseef or emulate its pattern matcher. For a push containing several commits, compare the old and new branch heads, not just the last commit's parent.
With the example lists above, these are expected outcomes for an ordinary push whose changed files Raseef can determine, not measured results:
| Change category | Web build expected | API build expected |
|---|---|---|
| Valid change inside apps/web | Yes | No |
| Valid change inside apps/api | No | Yes |
| Shared package used by both | Yes | Yes |
| Root workspace configuration or lockfile | Yes | Yes |
| docs only, unused by either build | No | No |
| docker/web.Dockerfile only | Yes | No |
If a row fails, preserve the evidence before changing configuration. A build appearing proves the trigger ran; a successful build proves an image was produced; neither alone proves the expected application version is serving. For a visible acceptance marker, use a non-sensitive test version string in a staging response and confirm it after rollout. Do not expose secrets through a diagnostic endpoint.
Troubleshoot by the stage that failed
No build after a push: check the exact branch, automatic-deploy toggle, repository access and complete changed-path range. Then compare paths against the service's full pattern list. A manual build succeeding points toward trigger configuration, not necessarily a cache problem.
Both apps rebuild after an unrelated change: check whether either service uses the repository root with empty watch paths. That default builds on every push. Also check for broad custom patterns. When Raseef cannot determine changed files—for example with a force push, new branch or very large push—it builds every service on that branch. This conservative fallback is documented behavior.
An intermediate commit has no build: Raseef builds the branch head when GitHub notifies it; a newer push replaces a queued build that has not started. Do not treat deployment history as a record of every commit or use auto-deployment as a guarantee that a per-commit migration ran.
Build starts but fails: inspect dependency installation, actual workspace build commands and Dockerfile inputs. Watch paths cannot repair missing build inputs. Raseef allows one active build per service and at most three per workspace; contention is separate from path matching.
Build succeeds but the old app remains live: inspect Deployments and Logs and verify readiness. The HTTP readiness guide explains why a listening port alone is insufficient. Restarting uses the running revision again; it is not a substitute for building the new commit.
Define success before optimizing
The useful acceptance criterion is: every change that can affect a service triggers its build, while demonstrated unrelated changes do not. Keep the dependency map and test record with your repository. Re-run the matrix when you add a shared package, move a Dockerfile or change workspace tooling.
This can avoid unnecessary builds, but no time or cost saving is measured here. Compare build counts and durations over a defined workload before making such a claim.
Raseef currently offers a private pilot. Request access if you want to run your application services on Raseef and validate your monorepo release workflow.