$npx -y skills add digitalocean-labs/do-app-platform-skills --skill deploymentDeploy applications to DigitalOcean App Platform via GitHub Actions with proper environment management and secrets handling. Use when setting up CI/CD pipelines, configuring staging/production environments, managing deployment secrets, or creating GitHub Actions workflows.
| 1 | # Deployment Skill |
| 2 | |
| 3 | Deploy to App Platform using GitHub Actions and the `app_action` workflow. |
| 4 | |
| 5 | ## Philosophy: PUSH Mode Deployment |
| 6 | |
| 7 | This skill focuses on **PUSH mode** — where you define infrastructure as code and GitHub Actions drives deployment. |
| 8 | |
| 9 | ``` |
| 10 | PULL MODE (Console-driven) — NOT covered by this skill |
| 11 | • Go to DigitalOcean Console → Create App → Point to GitHub |
| 12 | • App Platform auto-generates app spec |
| 13 | • Good for: Quick starts, manual one-offs |
| 14 | |
| 15 | PUSH MODE (CLI/Actions-driven) — THIS SKILL |
| 16 | • Define app spec in repo (.do/app.yaml) |
| 17 | • Use GitHub Actions + app_action to deploy |
| 18 | • Good for: CI/CD, automation, GitOps, multi-environment |
| 19 | ``` |
| 20 | |
| 21 | > **Tip**: For complex projects, consider the **planner** skill for staged approaches. See [root SKILL.md](../../SKILL.md) for all skills. |
| 22 | |
| 23 | --- |
| 24 | |
| 25 | ## Quick Decision |
| 26 | |
| 27 | ``` |
| 28 | Using GitHub Actions? (RECOMMENDED) |
| 29 | ├── YES → Use digitalocean/app_action/deploy@v2 |
| 30 | │ • Handles spec updates AND code deployments |
| 31 | │ • Manages app creation if doesn't exist |
| 32 | │ • Supports PR previews |
| 33 | │ |
| 34 | └── NO (Manual/Scripting) |
| 35 | ├── Spec changed? → doctl apps update --spec |
| 36 | └── Code only? → doctl apps create-deployment |
| 37 | ``` |
| 38 | |
| 39 | | Command | Purpose | When to Use | |
| 40 | |---------|---------|-------------| |
| 41 | | `doctl apps create --spec` | Create new app | First deployment only | |
| 42 | | `doctl apps update --spec` | Update app spec | Config changes | |
| 43 | | `doctl apps create-deployment` | Trigger rebuild | Code changes only | |
| 44 | | **app_action v2** | **Both spec + rebuild** | **Recommended: Handles everything** | |
| 45 | |
| 46 | --- |
| 47 | |
| 48 | ## Quick Start: Environment Setup |
| 49 | |
| 50 | ```bash |
| 51 | # 1. Create DigitalOcean projects |
| 52 | doctl projects create --name "myapp-staging" --environment "Staging" |
| 53 | doctl projects create --name "myapp-production" --environment "Production" |
| 54 | |
| 55 | # 2. Create GitHub environments |
| 56 | gh api --method PUT repos/:owner/:repo/environments/staging |
| 57 | gh api --method PUT repos/:owner/:repo/environments/production |
| 58 | |
| 59 | # 3. Set secrets per environment (user fills in values) |
| 60 | gh secret set DIGITALOCEAN_ACCESS_TOKEN --env staging |
| 61 | gh secret set DIGITALOCEAN_ACCESS_TOKEN --env production |
| 62 | gh variable set DO_PROJECT_ID --env staging --body "PROJECT_ID" |
| 63 | gh variable set DO_PROJECT_ID --env production --body "PROJECT_ID" |
| 64 | ``` |
| 65 | |
| 66 | **Full setup guide**: See [initial-setup.md](reference/initial-setup.md) |
| 67 | |
| 68 | --- |
| 69 | |
| 70 | ## Quick Start: Basic Workflow |
| 71 | |
| 72 | ```yaml |
| 73 | # .github/workflows/deploy.yml |
| 74 | name: Deploy |
| 75 | on: |
| 76 | push: |
| 77 | branches: [main] |
| 78 | jobs: |
| 79 | deploy: |
| 80 | runs-on: ubuntu-latest |
| 81 | environment: staging |
| 82 | steps: |
| 83 | - uses: actions/checkout@v4 |
| 84 | - uses: digitalocean/app_action/deploy@v2 |
| 85 | env: |
| 86 | DATABASE_URL: ${{ secrets.DATABASE_URL }} |
| 87 | with: |
| 88 | token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} |
| 89 | project_id: ${{ vars.DO_PROJECT_ID }} |
| 90 | ``` |
| 91 | |
| 92 | **All workflow templates**: See [workflow-templates.md](reference/workflow-templates.md) |
| 93 | |
| 94 | --- |
| 95 | |
| 96 | ## Workflow Selection |
| 97 | |
| 98 | | Scenario | Workflow | Reference | |
| 99 | |----------|----------|-----------| |
| 100 | | Simple single-environment | Minimum viable | [workflow-templates.md](reference/workflow-templates.md#minimum-viable-deployment) | |
| 101 | | Staging + production | Environment-based | [workflow-templates.md](reference/workflow-templates.md#basic-environment-deployment) | |
| 102 | | Production needs approval | Protected environment | [workflow-templates.md](reference/workflow-templates.md#production-deployment-with-approval) | |
| 103 | | Test PRs before merge | PR previews | [workflow-templates.md](reference/workflow-templates.md#pr-preview-environments) | |
| 104 | | Multiple envs, one workflow | Unified workflow | [workflow-templates.md](reference/workflow-templates.md#multi-environment-with-single-workflow) | |
| 105 | | Need to revert | Rollback | [workflow-templates.md](reference/workflow-templates.md#rollback-workflow) | |
| 106 | |
| 107 | --- |
| 108 | |
| 109 | ## Quick Start: Debug Container |
| 110 | |
| 111 | For complex apps with multiple integrations, deploy a debug container first: |
| 112 | |
| 113 | ```yaml |
| 114 | # Add to .do/app.yaml temporarily |
| 115 | workers: |
| 116 | - name: debug |
| 117 | image: |
| 118 | registry_type: GHCR |
| 119 | registry: ghcr.io |
| 120 | repository: bikramkgupta/do-app-debug-container-python |
| 121 | tag: latest |
| 122 | instance_size_slug: apps-s-1vcpu-2gb |
| 123 | envs: |
| 124 | - key: DATABASE_URL |
| 125 | scope: RUN_TIME |
| 126 | value: ${db.DATABASE_URL} |
| 127 | ``` |
| 128 | |
| 129 | ```bash |
| 130 | # Connect and verify |
| 131 | doctl apps console $APP_ID debug |
| 132 | ./diagnose.sh |
| 133 | ``` |
| 134 | |
| 135 | **Full guide**: See [debug-container-deployment.md](reference/debug-container-deployment.md) |
| 136 | |
| 137 | --- |
| 138 | |
| 139 | ## Quick Command Reference |
| 140 | |
| 141 | | Task | Command | |
| 142 | |------|---------| |
| 143 | | Validate spec | `doctl apps spec validate .do/app.yaml` | |
| 144 | | Create app | `doctl apps create --spec .do/app.yaml --project |