# Automatic Deployments

Source: https://next.coolify.io/docs/applications/deployments/automatic-deployments

Coolify can start a deployment when a Git provider reports a repository change or when an external workflow sends an authenticated deployment request.

Choose the trigger that matches how the application source is connected:

**Git integration**

Use this method when the application was created by selecting a repository through a [GitHub App](https://next.coolify.io/docs/applications/sources/github/app) or [GitLab source integration](https://next.coolify.io/docs/applications/sources/gitlab).

The integration receives provider events for Coolify, so you do not need to copy a manual Git webhook URL.

### Enable automatic deployments

Open the application, select **Advanced > Deployment**, then choose &#x2A;*Deploy on push (webhooks)** in **Auto deploy**.

### Push to the configured branch

Push a commit to the branch selected for the application. A push to another branch does not update the production application unless that branch is configured for a preview or another application.

### Verify the deployment

Open **Deployment Logs** and confirm a webhook deployment appears for the pushed commit.

If no deployment appears, inspect the provider integration and confirm the application still has access to the repository.

**Repository webhook**

Use this method for an application created from a public repository URL or &#x2A;*Private Repository (with deploy key)**.

These source types can clone the repository but do not automatically configure provider events. Add a manual Git webhook so the provider can notify Coolify.

### Copy the provider webhook URL

Open the application, select **Webhooks**, then copy the URL for the repository provider under **Manual Git webhooks**.

### Configure the secret

Enter a long random value in the matching **Webhook secret** field and select **Save changes**.

Create the webhook in the repository provider with the copied Coolify URL and the same secret. Do not reuse an account password, API token, or deploy key.

### Select repository events

Enable the provider's push event. Add pull-request or merge-request events only when the application also uses preview deployments.

Follow [Manual Git webhooks](https://next.coolify.io/docs/applications/deployments/manual-webhooks) for provider-specific event names and delivery settings.

### Enable and verify automatic deployments

Open **Advanced > Deployment**, choose &#x2A;*Deploy on push (webhooks)** in **Auto deploy**, then push a commit to the configured branch.

Open **Deployment Logs** and confirm a webhook deployment appears.

**External workflow**

Use this method when CI should run tests, approvals, or an external image build before it tells Coolify to deploy.

The authenticated **Deploy Webhook** starts a deployment directly. **Auto deploy** does not need to be set to deploy on push for this method.

### Create an API token

Create a Coolify [API token](https://next.coolify.io/docs/core/security/credentials/api-tokens) with permission to deploy the application.

### Copy the deploy webhook

Open the application, select **Webhooks**, then copy **Deploy webhook URL**.

Store the webhook URL and API token as secrets in the external CI system.

### Call Coolify after CI succeeds

Add the request after the workflow's tests, build, or approval steps:

```sh
curl --fail --request POST "$COOLIFY_WEBHOOK" \
  --header "Authorization: Bearer $COOLIFY_TOKEN"
```

The [GitHub Actions workflow](https://next.coolify.io/docs/applications/sources/github/actions#add-the-github-actions-workflow) shows the same authentication pattern in a complete example.

### Verify the deployment

Run the workflow, then open **Deployment Logs** and confirm Coolify received the authenticated request.

If the request fails, inspect the CI response and confirm that the webhook URL and token were stored without extra whitespace.

## Limit deployments by changed paths

Use **Watch Paths** under **General > Build** when a monorepo should deploy only after matching files change.

Enter one pattern per line. Commas do not separate patterns: Coolify reads `apps/api/**,packages/shared/**` as one pattern, so it does not match either directory.

Patterns are evaluated in order and support `*`, `**`, `?`, and negation with `!`. The last matching pattern wins.

For example:

```sh
apps/api/**
packages/shared/**
!apps/api/**/*.md
```

Watch paths filter Git provider webhook events that include changed-file information. They do not block deployments started manually from the dashboard or through the authenticated **Deploy Webhook**.

Test the patterns with a documentation-only commit before relying on them for production automation.

## Disable automatic Git deployments

Choose **Manual deployments only** under **Advanced > Deployment > Auto deploy** to keep the source connection while ignoring automatic commit deployments from Git provider events.

You can still select **Deploy** or **Redeploy**, or call the authenticated **Deploy Webhook** from an external workflow.
