Deployment
Prerequisites
fly auth login
Step 1: Create Fly.io Apps
fly apps create [YOUR_APP_NAME]
fly apps create [YOUR_APP_NAME]-stagingStep 2: Create a PostgreSQL Database
fly postgres create --name [YOUR_DB_NAME]Step 3: Attach the Database to Your App
Step 4: Configure Application Secrets
4.1: Create a Local Secrets File
4.2: Generate Secure Random Secrets
4.3: Set Cookie Secret on Fly.io
4.4: Prevent Search Engine Indexing on Staging
Step 5: Set Up GitHub Actions for CI/CD
5.1: Create a Fly API Token
5.2: Add the Token to GitHub Secrets
5.3: Add Your Production Secrets to GitHub
5.4: Create CI/CD Workflow File
Step 6: Push to GitHub
Step 7: Verify Deployment
Deployment Workflow
Troubleshooting
Database Connection Issues
Deployment Failures
Accessing the Database Console
Scaling Your Database
Security Considerations
Last updated