doctl apps create-deployment: Deploy on DO App Platform
doctl apps create-deployment <app-id> starts a fresh deployment of a DigitalOcean App Platform app, optionally waiting for it to finish.
On App Platform the CLI kicks off a deployment by app id. In CI you authenticate with a token, look up the id, and wait so the job reflects success or failure.
What it does
doctl apps create-deployment APP_ID asks App Platform to build and release the app's current spec/source. --wait blocks until the deployment reaches a terminal state and exits non-zero on failure. doctl apps list finds the app id, and doctl apps update applies a changed app spec.
Common usage
# auth via token, then trigger and wait
export DIGITALOCEAN_ACCESS_TOKEN=dop_v1_xxx
APP_ID=$(doctl apps list --format ID,Spec.Name --no-header | grep my-app | awk '{print $1}')
doctl apps create-deployment "$APP_ID" --waitOptions
| Command / flag | What it does |
|---|---|
| apps create-deployment <id> | Start a new deployment |
| --wait | Block until the deployment finishes |
| --force-rebuild | Rebuild from scratch, ignoring build cache |
| apps list | List apps to find the id |
| --access-token <t> | Auth token (or DIGITALOCEAN_ACCESS_TOKEN) |
| --format / --no-header | Shape output for scripting |
In CI
Set DIGITALOCEAN_ACCESS_TOKEN as an env var so no doctl auth init is needed, and add --wait so the step fails when the deployment fails. Use --format with --no-header to parse the app id reliably instead of scraping the default table.
Common errors in CI
"Error: Unable to initialize DigitalOcean API client: access token is required" means no token. "401 Unable to authenticate you" means an invalid or revoked token. "app not found" means the app id is wrong or belongs to another team; check doctl apps list.