Back to 🚢 DevOps & Deployment

Implement Blue-Green Deployment

DeploymentDevOpsZero-Downtime
---
description: Zero-downtime deploys
---

1. **Setup Two Environments**:
- Blue: Current (v1.0)
- Green: New (v1.1)

2. **Route Traffic Gradually**:
const rolloutPercent = await get('green_rollout') || 0;
if (Math.random() * 100 < rolloutPercent) {
return NextResponse.rewrite(new URL('/green', request.url));
}


3. **Monitor Metrics**:
Sentry.setTag('environment', isGreen ? 'green' : 'blue');


4. **Pro Tips**:
- Test thoroughly before routing.
- Keep blue for rollback.
By Antigravity Team

How to Use This Workflow

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/workflows/
  3. Save the file as implement-blue-green-deployment-strategy.md
  4. In Antigravity, type /implement_blue_green_deployment_strategy or just describe what you want to do

Learn more about workflows →

Related Workflows

Recommended Rules

View more rules →

Recommended MCP Servers

View more MCP servers →

Take It Further

Maximize your productivity with these powerful resources

📋

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
📖

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide