# Deployments

> Watch build logs, roll back to a previous build, and trigger deploys from a URL.

Source: https://gheima.ma/docs/deployments

Every build is a deployment. Watch it happen, roll back when needed, and trigger deploys from outside Gheima.

### Watch build & runtime logs

On the service page, the Logs tab has two views: “Build” streams the build step by step in real time; “Runtime” shows your running container’s output. Use the search box to filter, toggle auto-scroll, or download logs as a file.

### Roll back

1. **Open the Deployments tab** — You see every deployment newest-first, each with its commit and status.
2. **Redeploy a previous commit** — Click "Redeploy" on an earlier deployment to build and deploy that commit again.

> Note: The list refreshes automatically while a build is in progress (queued, building, or deploying).

### Deploy hooks (deploy via URL)

A deploy hook is a secret URL that triggers a deploy when something POSTs to it. Use it from CI or another external system. In Settings, click "Create deploy hook" (owners and admins only), then POST to the URL:

```bash
curl -X POST https://gheima.ma/api/deploy/hooks/<token>
```

Returns { ok: true, deploymentId }. Regenerate or disable the hook any time.

### Deployment statuses

- As a build proceeds, the deployment moves through Queued, Building, Pushing, and Deploying, then reaches Live.
- Failed means a step errored. Check the build logs, fix the problem, and push again.
- The list refreshes automatically while any deployment is in progress.

### Restart, pause & resume

- `Restart`: Redeploy (for repo services) or restart the running tasks.
- `Pause`: Stop all replicas (scale to zero) in the Danger zone.
- `Resume`: Bring a paused service back with its previous replica count.

> Note: Deploy hooks are rate-limited to 30 requests per minute per IP, and return 409 if the service has no connected repository.

> Result: You can deploy, roll back, and trigger deploys from the dashboard or any script.

---

All docs: https://gheima.ma/docs.md
