> ## Documentation Index
> Fetch the complete documentation index at: https://www.towbar.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Automation and previews

> Opt an app into automatic deployment, PR previews, notification routing, and scanning.

Repository sync does not by itself deploy an app. Opt in with `autoDeploy`, then list the repository paths that can change the built result:

```yaml title=".towbar/apps/web.app.yml" theme={"system"}
id: web
name: Web
autoDeploy:
  inputs:
    - package.json
    - pnpm-lock.yaml
    - apps/web/**
```

Include shared libraries, lockfiles, build scripts, and Dockerfiles as needed. The Repository's automation control can pause automatic work during maintenance. A manual **Deploy** remains a separate action. Start with one manual deployment and verify the running service before enabling automation.

## Pull request previews

Enable previews for an environment in `towbar.yml`, then opt the app in with a base domain:

```yaml title="towbar.yml" theme={"system"}
version: 2
environments:
  staging:
    previews:
      enabled: true
```

```yaml title=".towbar/apps/web.app.yml" theme={"system"}
preview:
  enabled: true
  domain: preview.example.com
  ttlHours: 72
environments:
  staging:
    server: 192.0.2.11
```

Eligible pull requests target the branch mapped to `staging`. Preview secrets are isolated from persistent environment values; resources do not create previews. Read [Preview environments](/docs/previews) for expiry and cleanup.

## Other automation

Use `notifications` to route an app's events to additional workspace-configured destinations. It takes effect after a successful environment sync without a deployment. `vulnerabilityScanning` controls image scanning, while `jobs` runs scheduled commands from the deployed image. Follow [Notifications](/docs/integrations/notifications), [Vulnerability scanning](/docs/vulnerability-scanning), and [Scheduled jobs](/docs/apps/jobs) for their separate configuration and execution rules.
