Commitc93926eunknown_key
ci: add Fly.io auto-deploy workflow (iPad-friendly, zero-terminal)
ci: add Fly.io auto-deploy workflow (iPad-friendly, zero-terminal) Triggers on push to main or claude/build-status-update-3MXsf, plus manual workflow_dispatch. Idempotent app + volume creation so the first run sets everything up; subsequent runs just redeploy. Requires FLY_API_TOKEN as a repo secret. Post-deploy smoke test hits /healthz with 5 retries. https://claude.ai/code/session_017Do52tMX1P9jPTWXhEohXH
1 file changed+64−0c93926e30b2fa6f490f868f142b5e1dfcee170a5
1 changed file+64−0
Added.github/workflows/fly-deploy.yml+64−0View fileUnifiedSplit
@@ -0,0 +1,64 @@
1name: Fly Deploy
2
3on:
4 push:
5 branches:
6 - main
7 - claude/build-status-update-3MXsf
8 workflow_dispatch: {}
9
10concurrency:
11 group: fly-deploy-${{ github.ref }}
12 cancel-in-progress: false
13
14jobs:
15 deploy:
16 name: Deploy to Fly.io
17 runs-on: ubuntu-latest
18 steps:
19 - uses: actions/checkout@v4
20
21 - name: Set up flyctl
22 uses: superfly/flyctl-actions/setup-flyctl@master
23
24 - name: Ensure app exists
25 run: |
26 if ! flyctl apps list --json 2>/dev/null | grep -q '"Name":\s*"gluecron"'; then
27 echo "Creating Fly app 'gluecron'..."
28 flyctl apps create gluecron --org personal
29 else
30 echo "App 'gluecron' already exists."
31 fi
32 env:
33 FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
34
35 - name: Ensure volume exists
36 run: |
37 if ! flyctl volumes list -a gluecron --json 2>/dev/null | grep -q '"Name":\s*"gluecron_repos"'; then
38 echo "Creating volume 'gluecron_repos' in iad..."
39 flyctl volumes create gluecron_repos --app gluecron --size 3 --region iad --yes
40 else
41 echo "Volume 'gluecron_repos' already exists."
42 fi
43 env:
44 FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
45
46 - name: Deploy
47 run: flyctl deploy --remote-only --app gluecron
48 env:
49 FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
50
51 - name: Smoke test
52 run: |
53 sleep 10
54 for i in 1 2 3 4 5; do
55 code=$(curl -s -o /dev/null -w "%{http_code}" https://gluecron.fly.dev/healthz || echo "000")
56 echo "Attempt $i: /healthz returned $code"
57 if [ "$code" = "200" ]; then
58 echo "Site is live."
59 exit 0
60 fi
61 sleep 10
62 done
63 echo "Site did not respond with 200 after 50s. Check 'fly logs -a gluecron'."
64 exit 1
065