From flyio-pack
Implements Fly.io advanced deployments: blue-green via Machines API, canary releases, multi-region rollouts using fly CLI and health checks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/flyio-pack:flyio-deploy-integrationThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Advanced deployment strategies for Fly.io beyond `fly deploy`. Covers blue-green with the Machines API, canary with traffic splitting, and multi-region coordinated rollouts.
Advanced deployment strategies for Fly.io beyond fly deploy. Covers blue-green with the Machines API, canary with traffic splitting, and multi-region coordinated rollouts.
async function blueGreenDeploy(appName: string, newImage: string) {
const client = new FlyClient(appName, process.env.FLY_API_TOKEN!);
const oldMachines = await client.listMachines();
// 1. Create new machines (green) with updated image
const greenMachines = await Promise.all(
oldMachines.map(m => client.createMachine(
{ ...m.config, image: newImage }, m.region
))
);
// 2. Wait for all green machines to be healthy
await Promise.all(greenMachines.map(m => client.waitForState(m.id, 'started')));
// 3. Verify health
for (const m of greenMachines) {
const healthy = await checkHealth(`https://${appName}.fly.dev/health`);
if (!healthy) {
// Rollback: destroy green, keep blue
await Promise.all(greenMachines.map(m => client.destroyMachine(m.id)));
throw new Error('Health check failed — rolled back');
}
}
// 4. Stop old machines (blue)
await Promise.all(oldMachines.map(m => client.stopMachine(m.id)));
console.log(`Deploy complete: ${greenMachines.length} new machines`);
}
# Deploy new version to a single machine
fly deploy -a my-app --strategy canary
# Monitor for 10 minutes
fly logs -a my-app --no-tail &
sleep 600
# If healthy, complete rollout
fly deploy -a my-app --strategy rolling
# If unhealthy, rollback
fly releases rollback -a my-app
# Deploy region by region
for region in iad lhr nrt; do
echo "Deploying to $region..."
fly deploy -a my-app --region $region
# Health check per region
curl -sf "https://my-app.fly.dev/health" \
-H "Fly-Force-Instance-Id: $(fly machine list -a my-app --json | jq -r ".[] | select(.region==\"$region\") | .id" | head -1)"
echo "Region $region healthy. Continuing..."
done
For webhook and event handling, see flyio-webhooks-events.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin flyio-packDeploy, configure, and manage applications on the Fly.io platform using flyctl CLI, fly.toml configuration, Fly Machines, Fly Volumes, private networking, secrets, health checks, autoscaling, and GitHub Actions CI/CD. Use when deploying any application to Fly.io, writing or modifying fly.toml configuration, managing Fly Machines or Volumes, configuring networking (public services, private 6PN, Flycast, custom domains, TLS), setting secrets, configuring health checks, setting up autostop/autostart or metrics-based autoscaling, deploying with GitHub Actions, managing Fly Postgres databases, or preparing an app for production on Fly.io.
Implements TypeScript clients and patterns for Fly.io Machines API: typed REST calls, lifecycle management, state waiting, multi-region deployments with Docker images.
Deploys and manages Fly.io apps using Docker containers, Fly Machines, fly.toml configs, databases, volumes, secrets. Supports fly launch/deploy, debugging, multi-region setups for Python/Node/Rails/Django apps.