Deployment
GitHub Actions
Deployments run via .github/workflows/deploy.yml when:
- Pushing to main with "Deploy" in the commit message (case-insensitive)
- Manual trigger: Actions → Deploy → Run workflow
Required GitHub secrets:
- FLY_API_TOKEN — for deploying both apps, use flyctl auth token (user-level). Deploy tokens (flyctl tokens create deploy) are app-specific and will cause "unauthorized" for the second app.
- AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ENDPOINT_URL_S3, AWS_BUCKET — pushed to Fly.io at deploy time for both apps
- GITHUB_DEPLOY_TOKEN (optional) — for build and runtime; falls back to GITHUB_TOKEN if unset
Manual deployment
The app can be deployed to fly.io manually using the following steps:
-
Install the flyctl CLI tool from fly.io
-
Log in to fly.io:
-
Source environment to get GITHUB_TOKEN
-
Deploy the app:
-
Scale the app:
-
Set secrets (choose one):
From GitHub Secrets (when using the deploy workflow): add via GitHub CLI:
# From .Renviron (source first)
source .Renviron
gh secret set FLY_API_TOKEN --body "$(flyctl auth token)"
gh secret set AWS_ACCESS_KEY_ID --body "$AWS_ACCESS_KEY_ID"
gh secret set AWS_SECRET_ACCESS_KEY --body "$AWS_SECRET_ACCESS_KEY"
gh secret set AWS_ENDPOINT_URL_S3 --body "$AWS_ENDPOINT_URL_S3"
gh secret set AWS_BUCKET --body "$AWS_BUCKET"
gh secret set GITHUB_DEPLOY_TOKEN --body "$GITHUB_TOKEN"
# Or set individually (gh will prompt for each value)
gh secret set FLY_API_TOKEN
gh secret set AWS_ACCESS_KEY_ID
gh secret set AWS_SECRET_ACCESS_KEY
gh secret set AWS_ENDPOINT_URL_S3
gh secret set AWS_BUCKET
gh secret set GITHUB_DEPLOY_TOKEN
From GitHub Secrets (when using the deploy workflow): add AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ENDPOINT_URL_S3, AWS_BUCKET to the repo’s Actions secrets. The workflow pushes them to Fly.io on each deploy.
From .Renviron (manual deploy):
source .Renviron
flyctl secrets set AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -a fprs-app
flyctl secrets set AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -a fprs-app
flyctl secrets set AWS_ENDPOINT_URL_S3=$AWS_ENDPOINT_URL_S3 -a fprs-app
flyctl secrets set AWS_BUCKET=$AWS_BUCKET -a fprs-app
flyctl secrets set GITHUB_TOKEN=$GITHUB_TOKEN -a fprs-app
flyctl secrets set AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -a fprs-engine
flyctl secrets set AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -a fprs-engine
flyctl secrets set AWS_ENDPOINT_URL_S3=$AWS_ENDPOINT_URL_S3 -a fprs-engine
flyctl secrets set AWS_BUCKET=$AWS_BUCKET -a fprs-engine
flyctl secrets set GITHUB_TOKEN=$GITHUB_TOKEN -a fprs-engine
The app will be available at https://research-strategy.fly.dev/
Local Docker Deployment
To run the app locally using Docker:
- Build the Docker image:
The app will be available at http://localhost:3838