How to Deploy App from GitHub on DigitalOcean App Platform
Link your GitHub repo via DigitalOcean control panel, select branch and source directory, configure resources and env vars, then enable autodeploy for automatic deployments on git pushes. App Platform auto-detects app types like static sites, Node.js, or Docker. Common issues like permissions or build failures resolve via logs and .do/app.yaml.
Prerequisites
- DigitalOcean account with billing enabled
- GitHub account with app source code repository
- GitHub permissions granted to DigitalOcean (auto on first deploy)
- Optional: .do/app.yaml for custom configs
- Environment variables for APIs/databases
Step-by-Step Instructions
Log in to DigitalOcean Dashboard
cloud.digitalocean.com and sign in to your DigitalOcean account. Ensure billing is set up since App Platform uses usage-based pricing with free tier limits for basic apps. Default region is NYC1.Navigate to Apps Section
Initiate App Creation
Connect GitHub Provider
Select Repository and Branch
yourusername/my-app). Set Branch to main or master. For monorepos, specify Source Directory like frontend/. App Platform auto-detects app type from files like package.json or Dockerfile. Click Next.Configure Resources
NODE_ENV=production). Click Next for detection checks.Review and Edit App Spec
sea-lion-app-l8cvv, must be unique). Choose Project (default or new). Keep Autodeploy enabled for git push deployments. Configure HTTP port (e.g., 8080) or Run Command like npm start. Click Next for review.Final Review and Create
Enable GitHub Actions (Advanced)
DIGITALOCEAN_ACCESS_TOKEN. Use name: Update App
on:
push:
branches: [main]
jobs:
deploy-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: digitalocean/app_action/deploy@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} in .github/workflows/deploy.yml.Common Issues & Troubleshooting
GitHub permissions error: 'Repository not accessible'
Reconnect GitHub in Apps page or re-authorize DigitalOcean access; ensure repo visibility matches account permissions.
Build failure: 'Module not found' or missing dependencies
Add required environment variables in Resources step; check Activity > Logs for exact errors and add package.json dependencies.
Database/API connection failed
Set env vars like DATABASE_URL in app config; verify credentials in DigitalOcean databases.
Deployment stuck or spec misconfiguration
Add .do/app.yaml to repo root for custom build/run commands; review auto-generated spec in wizard.
Autodeploy not triggering on git push
Confirm branch matches selected one; toggle Autodeploy in app settings; check GitHub-DO integration status.