Skip to content

Latest commit

 

History

History
157 lines (102 loc) · 2.71 KB

File metadata and controls

157 lines (102 loc) · 2.71 KB

Deployment

How to deploy this project to different environments.


Environments

Environment URL Branch Auto-deploy
Production https://app.example.com main Yes/No
Staging https://staging.example.com develop Yes/No
Preview PR-specific URLs PR branches Yes/No

Prerequisites

  • Access to deployment platform (e.g., AWS, Vercel, Railway)
  • Required credentials configured
  • CI/CD pipeline set up

Deployment Process

Automatic Deployments

Describe what triggers automatic deployments.

main branch → Production
develop branch → Staging
Pull requests → Preview environments

Manual Deployments

# Deploy to staging
# [Add your command here]

# Deploy to production
# [Add your command here]

Environment Variables

Production

Variable Description Where to set
DATABASE_URL Production database Platform secrets
API_KEY Production API key Platform secrets

Staging

Same as production, but with staging values.


Pre-deployment Checklist

  • All tests pass
  • Code reviewed and approved
  • Database migrations ready (if any)
  • Environment variables configured
  • Feature flags set (if applicable)

Database Migrations

Running Migrations

# Check pending migrations
# [Add your command here]

# Run migrations
# [Add your command here]

# Rollback (if needed)
# [Add your command here]

Migration Strategy

  • Migrations run automatically before deployment: Yes/No
  • Zero-downtime migration approach: Describe

Rollback Procedure

Quick Rollback

# Rollback to previous deployment
# [Add your command here]

Full Rollback (with database)

  1. Identify the last known good version
  2. Rollback database migrations (if safe)
  3. Deploy previous version
  4. Verify functionality

Monitoring

Health Checks

  • Endpoint: /health or /api/health
  • Expected response: 200 OK

Logs

# View production logs
# [Add your command here]

# View staging logs
# [Add your command here]

Alerts

Describe alerting setup (e.g., PagerDuty, Slack, email).


Troubleshooting

Deployment Failed

  1. Check CI/CD logs
  2. Verify environment variables
  3. Check for build errors
  4. Review recent changes

App Not Starting

  1. Check application logs
  2. Verify database connectivity
  3. Check environment variables
  4. Verify dependencies installed

Performance Issues Post-Deploy

  1. Check monitoring dashboards
  2. Review recent changes for N+1 queries, memory leaks
  3. Consider rollback if critical