doctl apps create-deployment Command Reference
Trigger a new deployment for a DigitalOcean App Platform app.
doctl apps create-deployment kicks off a fresh deployment of an existing App Platform app. In CI it ships the latest build and can block until the rollout is healthy.
What it does
doctl apps create-deployment requests a new deployment for the given app id, pulling the latest source or image per the app spec. With --wait it polls until the deployment succeeds or fails, making the result the job status.
Common flags and usage
- APP_ID: the id of the app to deploy (required)
- --wait: block until the deployment completes
- --force-rebuild: rebuild from source instead of reusing the last build
- --format / --no-header: shape output for parsing
- authenticate with doctl auth init or DIGITALOCEAN_ACCESS_TOKEN
Example
- name: Deploy to App Platform
env:
DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
run: |
doctl apps create-deployment "${APP_ID}" --wait --force-rebuildIn CI
Authenticate non-interactively by exporting DIGITALOCEAN_ACCESS_TOKEN from secrets (doctl reads it automatically). Use --wait so the job fails when the rollout fails rather than returning immediately, and --force-rebuild when you want a clean build from source.
Key takeaways
- create-deployment triggers a new App Platform rollout for an app id.
- --wait makes the job track the rollout to success or failure.
- Export DIGITALOCEAN_ACCESS_TOKEN from secrets for non-interactive auth.