How to Enable Auto-Deploy on DigitalOcean App Platform
Enable auto-deploy during app creation by checking the toggle after selecting your GitHub repo and branch, or toggle it in existing app settings under Actions or source config. Test by pushing code to the linked branch (default: main) and monitor in Activity/Deployments. Use do-app.yaml with deploy_on_push: true for CLI control.
Prerequisites
- DigitalOcean account with billing enabled
- GitHub repository with app source code
- DigitalOcean GitHub App installed with repo access
- App code binding to
0.0.0.0:$PORT(default 8080)
Step-by-Step Instructions
Log in and Start App Creation
Configure Source Directory
/ for root). Ensure your app listens on 0.0.0.0:$PORT or process.env.PORT || 8080 (Node.js example).[1][3][6]Enable Auto-Deploy Toggle
main or master).[1][5][6]Set Resources and Environment
DATABASE_URL for managed DBs.[1][6]Review and Create App
Verify Auto-Deploy Status
git push origin main and monitor Activity or Deployments tab.[1][5][6]Enable on Existing App
Use App Spec YAML (CLI Method)
name: your-app-name
services:
- name: web-service
source_dir: /
github:
repo: owner/repo
branch: main
deploy_on_push: true Create/edit do-app.yaml in repo root with this syntax, commit, and push to enable programmatically.[2]Common Issues & Troubleshooting
ContainerHealthChecksFailed
App fails HTTP health checks (e.g., Discord bot as web service). Switch service type to Worker, ensure port binding to 0.0.0.0:$PORT, check Build/Deploy Logs.[1][6]
Deployment not triggering on push
Verify GitHub App permissions, correct branch (main), and auto-deploy toggle enabled. Check Activity tab for errors.[5][6]
Build fails due to rate limits or Dockerfile issues
Use Linux AMD64-compatible Dockerfile, avoid restricted DB connections. Redeploy after fixes and monitor logs.[6][7]
Port misconfiguration
Bind explicitly to app.listen(process.env.PORT || 8080, '0.0.0.0'). Defaults to 8080; confirm in run command.[3][6]
Auto-deploy on wrong commits
Set specific branch in app settings or do-app.yaml. Use deploy_on_push: false for manual control if needed.[2]