Deployment Workflows
Standard deployment processes for FLYPILOT projects across different platforms.
Deployment Environments
Standard Setup
| Environment | Purpose | URL Pattern |
|---|---|---|
| Development | Developer testing | dev.clientsite.com |
| Staging | QA and client review | staging.clientsite.com |
| Production | Live site | clientsite.com |
Environment Parity
Ensure all environments match:
- Same PHP/Node version
- Same WordPress/framework version
- Same plugin/package versions
- Similar server configuration
WordPress Deployments
WPEngine
Git Push Deployment
# Add WPEngine remote (one-time)
git remote add production git@git.wpengine.com:production/clientsite.git
git remote add staging git@git.wpengine.com:staging/clientsite.git
# Deploy to staging
git push staging main
# Deploy to production
git push production main
Environment Variables
Set in WPEngine dashboard under "Environment Variables":
WP_ENVIRONMENT_TYPEGOOGLE_ANALYTICS_ID- Custom API keys
Deploy Checklist
- All changes tested on staging
- Database migrations complete
- Cache cleared after deploy
- Verify site loads correctly
- Check error logs
Kinsta
SSH Deployment
# Connect to Kinsta
ssh clientsite@ssh.kinsta.cloud -p 12345
# Pull latest changes
cd public
git pull origin main
# Clear cache
wp cache flush
Kinsta Deploy Hooks
Configure in Kinsta dashboard for automatic cache clearing after Git push.
Next.js Deployments
Vercel (Recommended)
Automatic Deployments
- Connect GitHub repository to Vercel
- Configure environment variables
- Push to branch triggers deployment
| Branch | Environment |
|---|---|
| main | Production |
| develop | Preview |
| feature/* | Preview |
Manual Deployment
# Install Vercel CLI
npm i -g vercel
# Deploy to preview
vercel
# Deploy to production
vercel --prod
Environment Variables
Set in Vercel dashboard:
NEXT_PUBLIC_*- Client-side variablesDATABASE_URL- Server-side secretsAPI_KEY- Server-side secrets
Railway
For backend services and cron jobs:
# Install Railway CLI
npm i -g @railway/cli
# Login
railway login
# Deploy
railway up
Shopify Deployments
Theme Deployment
# Push theme changes
shopify theme push
# Deploy to specific theme
shopify theme push --theme-id 123456789
# Deploy only specific files
shopify theme push --only templates/*.json
Deploy Checklist
- Preview changes in theme editor
- Test on development theme first
- Backup current live theme
- Deploy during low-traffic period
- Verify all pages render correctly
CI/CD Pipelines
GitHub Actions - WordPress
# .github/workflows/deploy.yml
name: Deploy to WPEngine
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deploy to WPEngine
uses: wpengine/github-action-wpe-site-deploy@v3
with:
WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPE_SSHG_KEY_PRIVATE }}
WPE_ENV: production
SRC_PATH: wp-content/themes/clientsite/
REMOTE_PATH: wp-content/themes/clientsite/
GitHub Actions - Next.js
# .github/workflows/deploy.yml
name: Deploy to Vercel
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
Pre-Deployment Checklist
Code Quality
- All tests passing
- Linting passes
- Type checking passes
- No console errors
- Code reviewed
Content & Data
- Database migrations ready
- Content updates staged
- Media files optimized
- Redirects configured
Performance
- Assets minified
- Images optimized
- Cache headers set
- CDN configured
Security
- No secrets in code
- Dependencies updated
- Security headers set
- SSL configured
Post-Deployment Verification
Smoke Tests
- Homepage loads
- Navigation works
- Key pages render
- Forms submit
- Authentication works
- Critical user flows complete
Monitoring
- Check error tracking (Sentry)
- Monitor server logs
- Verify analytics tracking
- Check Core Web Vitals
Rollback Procedures
WordPress (Git)
# Identify last working commit
git log --oneline
# Revert to previous commit
git revert HEAD
# Or reset to specific commit (careful!)
git reset --hard abc123
git push --force-with-lease
Vercel
# List recent deployments
vercel ls
# Rollback to previous deployment
vercel rollback [deployment-url]
Emergency Contacts
Document in project README:
- Lead developer contact
- DevOps contact
- Client contact
- Hosting support
CI/CD Auto-Rollback
The deploy.yml workflow implements automatic rollback on health check failure.
How It Works
Build Image -> Deploy -> Wait 30s -> Health Check (3 retries) -> Success/Rollback
|
+-- Pass -> Notify Success
+-- Fail -> Auto Rollback -> Notify
Health Check Behavior
| Setting | Value |
|---|---|
| Startup wait | 30 seconds |
| Retries | 3 |
| Delay between retries | 10 seconds |
| Timeout per request | 10 seconds |
| Expected response | HTTP 200 |
Automatic Rollback Process
When health checks fail:
- Previous SHA Lookup - Gets the image SHA that was running before deployment
- Rollback Deployment - Pulls and starts the previous image
- Slack Notification - Sends alert with failure details and rollback status
Manual Rollback
If automatic rollback fails or you need to rollback to a specific version:
Via GitHub Actions:
- Go to Actions > "Deploy with Auto-Rollback"
- Click "Run workflow"
- Select environment (staging/production)
- Enter the image SHA to rollback to in
rollback_sha - Click "Run workflow"
Slack Notifications
The workflow sends notifications for:
- Successful deployment - Green, includes deployed SHA
- Automatic rollback - Yellow/warning, includes both failed and restored SHAs
- Manual intervention required - Red/danger, when no previous version exists
Production Deployments
Always deploy during low-traffic periods. Have rollback plan ready before deploying.