agentleFS
digitalocean-labsdigitalocean-labs/do-app-platform-skills/skills/deployment/SKILL.md

deployment

Skill36 starsChanged 10 months agoMITView on GitHub

Deploy 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.

  • Reads credentials

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use debugging, api-design and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • BlockSkill

    debugging

    Debugging guidelines and best practices

    Also in 5 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 4 projects that use this

  • NVIDIASkill

    testing

    Run Python and Rust tests for physicsnemo-curator using uv + pytest with coverage reporting via pytest-cov, and cargo-nextest for Rust tests. Includes benchmark workflows with pytest-benchmark and criterion.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    ← devcontainers: Ensure local dev matches production

    line 204

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Deployment Skill

Deploy to App Platform using GitHub Actions and the app_action workflow.

Philosophy: PUSH Mode Deployment

This skill focuses on PUSH mode — where you define infrastructure as code and GitHub Actions drives deployment.

PULL MODE (Console-driven) — NOT covered by this skill
• Go to DigitalOcean Console → Create App → Point to GitHub
• App Platform auto-generates app spec
• Good for: Quick starts, manual one-offs

PUSH MODE (CLI/Actions-driven) — THIS SKILL
• Define app spec in repo (.do/app.yaml)
• Use GitHub Actions + app_action to deploy
• Good for: CI/CD, automation, GitOps, multi-environment

Tip: For complex projects, consider the planner skill for staged approaches. See root SKILL.md for all skills.


Quick Decision

Using GitHub Actions? (RECOMMENDED)
├── YES → Use digitalocean/app_action/deploy@v2
│         • Handles spec updates AND code deployments
│         • Manages app creation if doesn't exist
│         • Supports PR previews
│
└── NO (Manual/Scripting)
    ├── Spec changed? → doctl apps update --spec
    └── Code only? → doctl apps create-deployment
CommandPurposeWhen to Use
doctl apps create --specCreate new appFirst deployment only
doctl apps update --specUpdate app specConfig changes
doctl apps create-deploymentTrigger rebuildCode changes only
app_action v2Both spec + rebuildRecommended: Handles everything

Quick Start: Environment Setup

# 1. Create DigitalOcean projects
doctl projects create --name "myapp-staging" --environment "Staging"
doctl projects create --name "myapp-production" --environment "Production"

# 2. Create GitHub environments
gh api --method PUT repos/:owner/:repo/environments/staging
gh api --method PUT repos/:owner/:repo/environments/production

# 3. Set secrets per environment (user fills in values)
gh secret set DIGITALOCEAN_ACCESS_TOKEN --env staging
gh secret set DIGITALOCEAN_ACCESS_TOKEN --env production
gh variable set DO_PROJECT_ID --env staging --body "PROJECT_ID"
gh variable set DO_PROJECT_ID --env production --body "PROJECT_ID"

Full setup guide: See initial-setup.md


Quick Start: Basic Workflow

# .github/workflows/deploy.yml
name: Deploy
on:
  push:
    branches: [main]
jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: staging
    steps:
      - uses: actions/checkout@v4
      - uses: digitalocean/app_action/deploy@v2
        env:
          DATABASE_URL: ${{ secrets.DATABASE_URL }}
        with:
          token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
          project_id: ${{ vars.DO_PROJECT_ID }}

All workflow templates: See workflow-templates.md


Workflow Selection

ScenarioWorkflowReference
Simple single-environmentMinimum viableworkflow-templates.md
Staging + productionEnvironment-basedworkflow-templates.md
Production needs approvalProtected environmentworkflow-templates.md
Test PRs before mergePR previewsworkflow-templates.md
Multiple envs, one workflowUnified workflowworkflow-templates.md
Need to revertRollbackworkflow-templates.md

Quick Start: Debug Container

For complex apps with multiple integrations, deploy a debug container first:

# Add to .do/app.yaml temporarily
workers:
  - name: debug
    image:
      registry_type: GHCR
      registry: ghcr.io
      repository: bikramkgupta/do-app-debug-container-python
      tag: latest
    instance_size_slug: apps-s-1vcpu-2gb
    envs:
      - key: DATABASE_URL
        scope: RUN_TIME
        value: ${db.DATABASE_URL}
# Connect and verify
doctl apps console $APP_ID debug
./diagnose.sh

Full guide: See debug-container-deployment.md


Quick Command Reference

TaskCommand
Validate specdoctl apps spec validate .do/app.yaml
Create appdoctl apps create --spec .do/app.yaml --project-id $PROJECT_ID
Update appdoctl apps update $APP_ID --spec .do/app.yaml
Redeploydoctl apps create-deployment $APP_ID
View logsdoctl apps logs $APP_ID --type run
Set secretgh secret set NAME --env staging
List secretsgh secret list --env staging

Full reference: See command-reference.md


Reference Files

FileContent
initial-setup.mdProjects, environments, secrets, app spec setup
workflow-templates.mdAll GitHub Actions workflow YAML templates
debug-container-deployment.mdDebug container for infrastructure verification
command-reference.mdComplete doctl and gh CLI commands

Quick Troubleshooting

IssueSymptomFix
App spec not foundError: spec file not foundEnsure .do/app.yaml exists
Invalid token401 UnauthorizedCheck DIGITALOCEAN_ACCESS_TOKEN secret
Project not foundproject_id is invalidVerify DO_PROJECT_ID variable
Build failsBuildJobFailedCheck build logs: doctl apps logs $APP_ID --type build
Env vars literalValues show ${...}Check bindable variable names match

Opinionated Defaults

DecisionDefaultRationale
CI PlatformGitHub ActionsBest DO integration via app_action
Deploy Actionapp_action/deploy@v2Handles spec + deploy in one step
SecretsGitHub Secrets per environmentSecure, AI never sees values
deploy_on_pushfalse in app specLet GitHub Actions control deploys
App spec location.do/app.yamlConventional, matches DO button

Integration with Other Skills

  • ← designer: Creates .do/app.yaml that deployment consumes
  • ← postgres: Handles database setup, stores DATABASE_URL in GitHub Secrets
  • → troubleshooting: Debug deployment failures
  • ← devcontainers: Ensure local dev matches production

Production Checklist

  • DO Projects created with environment tags
  • GitHub environments created (staging, production)
  • DIGITALOCEAN_ACCESS_TOKEN secret set per environment
  • DO_PROJECT_ID variable set per environment
  • .do/app.yaml with deploy_on_push: false
  • .github/workflows/deploy.yml created
  • Production protection rules enabled
  • Staging deployment tested
  • Production deployment tested

Documentation Links

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.