/setup-deployment
Automatically detect your project type and configure a complete deployment pipeline with platform-specific configurations, CI/CD workflows, and environment management.
Quick Start
/agileflow:setup-deployment PLATFORM=auto ENV=both AUTO_DEPLOY=noPurpose
This command intelligently sets up deployment infrastructure by:
- Auto-detecting your project type (static, full-stack, serverless, mobile, containers)
- Recommending the optimal deployment platform
- Generating platform-specific configuration files
- Creating GitHub Actions deployment workflows
- Setting up environment variable templates and secrets management
- Providing clear next steps for deployment
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
PLATFORM | No | auto | auto, vercel, netlify, heroku, aws, gcp, docker, eas |
ENV | No | both | staging, production, or both |
AUTO_DEPLOY | No | no | yes or no - trigger deployment automatically on push |
Examples
Auto-Detect Everything
/agileflow:setup-deploymentDetects project type and recommends the best platform automatically.
Specify Platform Explicitly
/agileflow:setup-deployment PLATFORM=vercel ENV=bothSets up Vercel deployment for both staging and production.
Docker Deployment to Fly.io
/agileflow:setup-deployment PLATFORM=docker ENV=productionConfigures Docker-based deployment (works with Fly.io, AWS, GCP).
Mobile App with EAS
/agileflow:setup-deployment PLATFORM=eas ENV=productionSets up Expo Application Services for React Native/Expo deployment.
Project Detection
The command analyzes your project to recommend platforms:
Static Sites
Detected By: HTML/CSS/JS, React/Vue/Angular SPA (no backend)
- Recommended: Vercel or Netlify
- Ideal for: Marketing sites, SPAs, documentation
Full-Stack Web Apps
Detected By: Node.js server, Express/Fastify/Next.js API routes
- Recommended: Vercel (Next.js) or Railway
- Ideal for: Web apps with backend logic
Mobile Apps (React Native / Expo)
Detected By: expo config, react-native dependency
- Recommended: EAS (Expo Application Services)
- Ideal for: iOS/Android mobile apps
Container-Based Apps
Detected By: Dockerfile present
- Recommended: Fly.io
- Ideal for: Custom Docker deployments, microservices
Serverless Functions
Detected By: Lambda functions, API Gateway config
- Recommended: AWS Lambda or Vercel Functions
- Ideal for: Event-driven, pay-per-execution workloads
Output Files
The command creates several configuration files:
Platform Configuration
- Vercel:
vercel.json - Netlify:
netlify.toml - Heroku:
Procfile,app.json - Docker:
Dockerfile,.dockerignore,fly.toml - EAS:
eas.json - AWS Lambda:
serverless.yml
CI/CD Workflow
.github/workflows/deploy.yml- Automated deployment workflow- Supports staging → production promotion
- Runs on push to staging/main branches
Environment Management
.env.example- Template for environment variables (safe to commit)docs/02-practices/secrets-management.md- Secrets management guidedocs/02-practices/deployment.md- Deployment documentation
Platforms
Vercel (Recommended for Next.js/React)
Best for: Next.js, React, SPA deployments
- Automatic builds on git push
- Global CDN
- Built-in serverless functions
- Environment management UI
- Preview deployments on PRs
Next Steps:
vercel link # Connect your GitHub repo
vercel env add DATABASE_URL production
git push origin main # Trigger deploymentNetlify (Recommended for Static Sites)
Best for: Static sites, JAMstack, general SPAs
- Automatic builds from git
- Built-in analytics and forms
- Serverless functions
- Netlify CMS integration
- Custom domain management
Heroku (Node.js/Python Servers)
Best for: Traditional server applications
- Simple slug-based deployment
- PostgreSQL, Redis add-ons
- Environment variable management
- Team collaboration features
Next Steps:
heroku login
heroku create my-app
heroku addons:create heroku-postgresql:hobby-dev
git push heroku mainFly.io (Docker Deployment)
Best for: Docker containers, microservices, custom runtimes
- Global deployment with anycast routing
- IPv6 support
- Auto-scaling
- Persistent volumes
- PostgreSQL included
Next Steps:
fly auth login
fly launch
fly deployAWS (Lambda/ECS/Elastic Beanstalk)
Best for: Scalable applications, microservices
- Multiple deployment options (Lambda, ECS, Beanstalk)
- Cost-effective at scale
- Integration with AWS ecosystem
- Fine-grained access control
EAS (Expo/React Native)
Best for: Mobile apps (iOS/Android)
- Native builds in the cloud
- App Store/Play Store submissions
- OTA updates
- Development client builds
Workflow
The setup follows a consistent process:
- Detect Project Type - Analyzes dependencies and files
- Recommend Platform - Suggests optimal hosting
- Generate Configuration - Creates platform-specific files
- Create Workflow - Sets up GitHub Actions for deployment
- Environment Setup - Creates
.env.exampleand docs - Show Preview - Displays all files for review
- Create Files - Writes to disk after YES/NO confirmation
- Display Next Steps - Guides setup completion
Environment Management
Staging vs Production
The command can set up either or both environments:
# Example: Two-branch deployment
Staging:
- Branch: staging
- URL: staging.example.com
- Environment: development-like
Production:
- Branch: main
- URL: example.com
- Environment: liveSecrets Management
Never commit secrets to git. Instead:
- Use
.env.exampleas a template - Store actual secrets in platform (Vercel, Heroku, etc.)
- GitHub Actions provides
${{ secrets.NAME }} - Read
docs/02-practices/secrets-management.mdfor details
Common Secrets:
- Database connection strings
- API keys (Stripe, SendGrid, etc.)
- AWS credentials
- Third-party service tokens
Examples by Platform
Vercel Deployment
/agileflow:setup-deployment PLATFORM=vercelCreates:
vercel.jsonwith build config.github/workflows/deploy.ymlfor auto-deploy.env.examplewith Vercel variable names- Deployment docs
Heroku with PostgreSQL
/agileflow:setup-deployment PLATFORM=heroku ENV=productionCreates:
Procfile(web: npm start)app.jsonwith buildpack config- PostgreSQL setup docs
- Deployment workflow
Docker to Fly.io
/agileflow:setup-deployment PLATFORM=dockerCreates:
Dockerfilewith multi-stage build.dockerignorefor clean imagefly.tomlwith region and volume config- Deployment workflow
Auto-Deploy Option
By default, deployments require manual triggering. To enable automatic deployment on every push:
/agileflow:setup-deployment AUTO_DEPLOY=yesImportant: Use with caution in production. Consider:
- Always require CI to pass first
- Use staging → main promotion process
- Implement feature flags for gradual rollouts
- Monitor error tracking after deployments
Next Steps After Setup
-
Add Platform Connection
vercel link # or fly auth login fly launch -
Configure Secrets
vercel env add DATABASE_URL production # or fly secrets set DATABASE_URL=postgresql://... -
Test Deployment
git push origin staging # Check deployment logs on platform dashboard -
Set Custom Domain (Optional)
vercel domains add example.com # Follow platform-specific DNS setup -
Enable Auto-Deploy (Optional)
- After testing staging, enable production auto-deploy
- Configure branch protection rules
Related Commands
/ci-setup- Set up CI/CD testing and checks/setup-tests- Configure testing framework/generate-changelog- Create release notes
On This Page
/setup-deploymentQuick StartPurposeParametersExamplesAuto-Detect EverythingSpecify Platform ExplicitlyDocker Deployment to Fly.ioMobile App with EASProject DetectionStatic SitesFull-Stack Web AppsMobile Apps (React Native / Expo)Container-Based AppsServerless FunctionsOutput FilesPlatform ConfigurationCI/CD WorkflowEnvironment ManagementPlatformsVercel (Recommended for Next.js/React)Netlify (Recommended for Static Sites)Heroku (Node.js/Python Servers)Fly.io (Docker Deployment)AWS (Lambda/ECS/Elastic Beanstalk)EAS (Expo/React Native)WorkflowEnvironment ManagementStaging vs ProductionSecrets ManagementExamples by PlatformVercel DeploymentHeroku with PostgreSQLDocker to Fly.ioAuto-Deploy OptionNext Steps After SetupRelated Commands