# Deploys

> The history behind every target — what was built, from which commit, and how to go back

URL: https://pier.run/docs/deploys

Every release of an app or site target is a deploy: a row with the image or bundle it
produced, the commit it came from (when it came from one), who triggered it and the build
log.

```bash
pier deploys ls api
```

```text title="output"
                                                                                        
 STATUS     TYPE RESOURCE ENV  COMMIT  MESSAGE                                  CREATED 
                                                                                        
 succeeded  app  api      prod da2b... fix(configdiff): a volume binding is ... 26s ago 
 superseded app  api      prod         zot.pier-registry.svc.cluster.local:5... 1m ago  
 superseded app  api      prod         zot.pier-registry.svc.cluster.local:5... 2m ago  
 succeeded  app  api      prod da2b... fix(configdiff): a volume binding is ... 3m ago  
                                                                                        

```

| Status      | Means                                                           |
| ----------- | --------------------------------------------------------------- |
| `pending`   | waiting for a build to finish                                   |
| `building`  | the build is running (`pier deploys logs <id>` streams it)      |
| `succeeded` | built and rolled; the target runs this deploy                   |
| `failed`    | the build or the roll failed; the previous deploy keeps running |

## Commands

| Command                                    | Does                                    |
| ------------------------------------------ | --------------------------------------- |
| `pier deploys` / `pier deploys ls [<ref>]` | the history, newest first               |
| `pier deploys info <id>`                   | image, commit, author, timing, strategy |
| `pier deploys logs <id>`                   | the build log                           |
| `pier rollback <ref> [--to <id>]`          | run a previous deploy's image or bundle |

## Behaviour

* A deploy never changes variables; a [rollback](/docs/guides/roll-back-a-deploy) runs
  an older image with the current environment version.
* Deploys are kept with the target. A removed app's history is kept in
  [trash](/docs/concepts#trash) and restored with it.
* `pier status` shows, per target, the running deploy and anything staged that the next
  `pier deploy` would release.

## See also

[Roll back a deploy](/docs/guides/roll-back-a-deploy) · [Builds](/docs/builds) · [`pier deploys`](/docs/cli/reference/deploys)
