# Deployments

> What starts a deployment, what happens in each step, what each status means, and how to cancel, roll back, restart or pause.

A deployment takes one commit of your branch, builds it and puts it online. Each one is kept in the list under **Deployments**, with its commit, who started it, how long it took and its build log.

![A push is built, released and then live](https://arrangic.com/docs/img/deployment.svg)

## What starts a deployment

| Trigger | When |
| --- | --- |
| Git push | You push to the branch of the app, and **Deploy on push** is on |
| Manual | You choose **Deploy** at the top of the app. The newest commit of the branch is deployed |
| Redeploy | You choose **Restart**, or **Redeploy now** after a change to variables or settings. The current version is put online again with the settings as they are now |
| Rollback | You choose **Roll back to this** on an earlier deployment |
| Domain change | You add, remove or change a domain. The current version is rolled out again so it answers at the new address |

The first deployment starts by itself when you create the app.

## The steps

1. **Build.** The code of that commit is fetched, your packages are installed and your build command runs. A build may take up to 30 minutes. See [Build settings](https://arrangic.com/docs/build-settings.md).
2. **Deploy commands.** If you set any, they run now, once. See [Deploy commands](https://arrangic.com/docs/deploy-commands.md).
3. **Release.** The new version starts on one replica first. It has 2 minutes to start listening on its port. Then the other replicas follow.

If a step fails, the deployment stops and the version that was running stays online. Your visitors do not see a failed deployment.

## Status

| Status | Meaning |
| --- | --- |
| Queued | It waits to start |
| Building | Packages are installed and the build command runs |
| Deploying | The new version is being released |
| Live | This version answers requests now |
| Superseded | It was live until a newer deployment went live |
| Failed | A step failed. The deployment page says which, and why |
| Cancelled | It was stopped before it finished |

## Deploy on push

**Deploy on push** is on for a new app: every push to the branch starts a deployment. Switch it off under **Settings**, **General** to deploy by hand only. The change applies as soon as you save.

## Cancel a deployment

Open the deployment and choose **Cancel deployment**. This works until the release has started. After that, let it finish and roll back if you need to.

## Roll back

Open an earlier deployment under **Deployments** and choose **Roll back to this**.

- **It is quick when the build is still kept.** The builds of recent deployments are kept and reused. For an older one, the commit is built again first.
- **It uses your settings as they are now.** Variables and scaling are the current ones, not those of that day.
- **Deploy commands do not run.** A rollback does not undo a database migration. Check that the old code still works with the database as it is.

## Restart

**Restart** puts the current version online again on every replica, for an app that hangs or leaks memory. It counts as a deployment and appears in the list.

## Pause and resume

**Pause**, under **More actions**, stops the app and removes its replicas. A paused app does not deploy: pushes are ignored until you choose **Resume**.

---

This page on the site: https://arrangic.com/docs/deployments  
All pages of the documentation: https://arrangic.com/llms.txt
