# Deploy on push and previews

> Redeploy on every push to your branch and get a preview address for other branches.

Source: https://daster.io/docs/hosting/deploy-on-push-and-previews/ · Last updated: 2026-11-21

## Turn it on

A service you create from GitHub in the **Deploy an app** wizard has **Deploy on every push** turned on already, if you can manage Hosting. If turning it on failed, the wizard warns you; turn it on here.

1. Open **Hosting › Build & deploy settings**.
2. Turn on **Deploy on every push** to redeploy the app on each push to its production branch (the branch it was created with).
3. Turn on **Preview deployments** to get a preview for pushes to any other branch. Previews are for web services only.

Saving these settings makes you the push actor: pushes are deployed with your GitHub access. If you lose access, the app ignores pushes until a manager saves the settings again.

## Production and previews

The **Production and previews** card lists the production line and each preview, with its address (**Visit**), status and last push.

- The first push to a branch creates its preview; later pushes update it. The preview's address stays the same.
- Each preview runs on the Starter size with one instance.
- A preview starts with **no variables**. Production variables, project shared variables and the project connection are never copied to previews, so code from an unreviewed branch never receives your secrets.

## When previews are removed

- The branch is deleted.
- The preview gets no push for its retention time (default 7 days, 1 to 30).
- You turn **Preview deployments** off (the page asks first when previews are open).
- You choose **Remove** on the card (needs a sign-in within the last 10 minutes).

## Rules

- **Newest wins:** a newer push to the same branch replaces one that is still waiting.
- One app and its previews never build at the same time.
- A stopped app ignores pushes until it is deployed again.
- Deleting the production branch never removes the app.

## When a repository moves

GitHub keeps a repository's ID when you transfer it to another account or organization, but its pushes then come from that account's installation of the DASTER GitHub App. On the first push after the move, DASTER asks GitHub, with the push actor's own access, where the repository is installed now. If it is the installation the push came from, the app is linked to it again and the push deploys as usual. Otherwise the app keeps its old link and ignores the push, so someone who took over a repository can never deploy into your app.

If pushes stop deploying after a move, turn **Deploy on every push** off and on again to link the app by hand.

## With the API

```http
PUT /v1/projects/{projectId}/compute/services/{serviceId}/push?organizationId={organizationId}
Content-Type: application/json

{ "autoDeploy": true, "previews": true, "previewRetentionDays": 7 }
```

`GET …/push` returns the settings and the 20 most recent pushes. Each push has a `state`: `pending`, `queued`, `superseded`, `skipped` or `failed`. `GET …/previews` lists previews; `DELETE …/previews/{previewId}` with `{ "confirmed": true }` removes one.
