Files
kennethreitz 32bced2927 Enable blue-green deployment strategy
Changes:
- Added [deploy] strategy = "bluegreen" to fly.toml
- Increased min_machines_running from 1 to 2
- Disabled auto_stop_machines to keep both environments ready
- Updated GitHub Actions workflow with --strategy bluegreen flag

How Blue-Green Works:
1. Deploy creates new "green" environment alongside current "blue"
2. Health checks verify green environment is healthy
3. Traffic switches instantly from blue to green
4. Old blue environment kept briefly for instant rollback
5. Zero downtime during deployments

Cost Impact:
- Runs minimum 2 machines instead of 1
- Ensures true zero-downtime deployments
- Instant rollback capability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 13:52:19 -05:00

32 lines
775 B
YAML

# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
name: Fly Deploy
on:
push:
branches: [main]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- run: uv python install 3.13
- run: uv sync --extra dev
- run: uv run pytest tests/ -n auto --tb=short
deploy:
name: Deploy app
runs-on: ubuntu-latest
needs: test
concurrency: deploy-group
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only --strategy bluegreen
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}