# How to deploy an app with one command

Deploy a prepared single app with one synchronous Ample command and get a live or failed result without polling.

## the short version

After Ample is installed and authenticated, a prepared single app can be deployed from its project directory with `ample deploy`. The command is synchronous: it exits when the release is live or failed. If the source and configuration are unchanged, the next run is a content-addressed no-op that returns the existing live URL.

## Who this is for

This guide is for builders with one deployable app at the repo root who want the shortest path from source to a live result.

## How to do it

1. **Open the app directory.** Run the command from the directory that contains the app's package files and production source.

2. **Deploy.** For a single public web app, Ample detects the common build and start path and waits for the release.

```sh
   $ ample deploy
   ```

3. **Read the final result.** Exit code 0 means live, 1 means failed, and 2 means a required preflight action is unresolved. JSON output includes status, unchanged, deployment_id, and server_id.

4. **Diagnose a failure before retrying.** A failed deploy is not a status to poll. Read the relevant logs, fix the cause, and deploy the changed source.

```sh
   $ ample logs <deployment_id> --kind build
   ```

## What this supports

- A single app at the project root
- Automatic detection for common builds and runtimes
- Public URLs for web and static apps
- Content-addressed no-op redeploys

## Know the limits

- Multi-service repos should be planned and applied with ample plan and ample up
- Ambiguous runtimes may require an explicit plan or runtime
- A failed unchanged release needs a source fix or an intentional force retry

## Common failure modes

- **The command exits with code 2**: Resolve the named preflight or plan question before deploying.
- **The build succeeds but activation fails**: Read runtime logs and confirm the start command, PORT binding, and health path.
- **You need to reactivate unchanged source**: Use `ample deploy --force` only when you intentionally want a fresh rebuild and activation.
