Run staging on a single Fly machine
Staging stores sessions in machine-local SQLite with no shared volume. Fly's default deploy provisions two machines (HA), so requests after login could land on the machine that never wrote the session row, bouncing logged-in users straight back to the login page. Deploy with --ha=false and scale count 1 so each per-branch staging app runs on exactly one machine. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YWAvjVEAibhwbeVgbYmg94
This commit is contained in:
@@ -49,7 +49,13 @@ jobs:
|
||||
"APP_URL=https://${HOST}"
|
||||
|
||||
- name: Deploy
|
||||
run: flyctl deploy --app "$APP" --config fly.staging.toml --remote-only --yes
|
||||
# --ha=false so Fly provisions a single machine. Staging stores sessions
|
||||
# in machine-local SQLite (no shared volume), so a second machine would
|
||||
# serve requests it has no session for, bouncing logged-in users back to
|
||||
# the login page. scale count 1 fixes apps already created with two.
|
||||
run: |
|
||||
flyctl deploy --app "$APP" --config fly.staging.toml --remote-only --yes --ha=false
|
||||
flyctl scale count 1 --app "$APP" --yes
|
||||
|
||||
- name: Summary
|
||||
run: echo "Deployed to https://${HOST}" >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
Reference in New Issue
Block a user