Skip to content

Latest commit

 

History

History
131 lines (107 loc) · 3.53 KB

progress.md

File metadata and controls

131 lines (107 loc) · 3.53 KB

Staging Environment Setup Progress

Goal

Set up a clean staging environment with:

  • develop branch deploying to staging backend
  • main branch deploying to production backend
  • TestFlight builds pointing to appropriate environments

Current Stack

  • Backend: Fly.io (Elysia.js + Bun)
  • Frontend: Expo/React Native + EAS builds
  • Database: Neon PostgreSQL (with staging branch)
  • Secrets: Doppler (staging + prod configs)

Completed

1. Fly Staging App Created

2. GitHub Actions Workflow

  • File: .github/workflows/deploy.yml
  • Deploys to staging on push to develop
  • Deploys to production on push to main
  • Requires FLY_API_TOKEN secret in GitHub

3. Dockerfile Fixed for Bun Workspaces

Resolved several issues with Bun workspace resolution in Docker:

Issue Solution
zod@catalog: failed to resolve Copy root package.json + bun.lock
Workspace not found "frontend" Copy all workspace package.json files
frontend/package.json not found Updated .dockerignore to allow it
Cannot find package 'zod' in shared Install shared deps with --filter

Final working approach: Simple Dockerfile that installs from backend directory.


Remaining Manual Steps

1. Add Fly API Token to GitHub

fly tokens create deploy -a tldr-summarizer-api-staging

Then add FLY_API_TOKEN to GitHub repo → Settings → Secrets → Actions

2. Sync Doppler Secrets to Staging App

doppler secrets download --config staging --no-file | fly secrets import -a tldr-summarizer-api-staging

3. Create develop Branch

git checkout main
git pull origin main
git checkout -b develop
git push -u origin develop

4. Set Up Branch Protection (GitHub Settings → Branches)

Branch Rules
main Require PR, require status checks, no direct push
develop Require PR from feature branches (optional)

5. EAS Staging Build Profile (Optional)

Add to frontend/eas.json:

{
  "build": {
    "staging": {
      "distribution": "internal",
      "channel": "staging",
      "env": {
        "EXPO_PUBLIC_API_URL": "https://tldr-summarizer-api-staging.fly.dev"
      }
    },
    "production": {
      "autoIncrement": true,
      "channel": "production",
      "env": {
        "EXPO_PUBLIC_API_URL": "https://tldr-summarizer-api.fly.dev"
      }
    }
  }
}

Then build with:

eas build --profile staging --platform ios

6. TestFlight Setup

  1. Build staging: eas build --profile staging --platform ios
  2. Submit: eas submit --platform ios
  3. In App Store Connect → TestFlight → Internal Testing:
    • Create "Staging Testers" group
    • Add staging builds to this group

Files Created/Modified

File Status
fly.staging.toml ✅ Created
.github/workflows/deploy.yml ✅ Created
Dockerfile ✅ Fixed for workspaces
.dockerignore ✅ Modified
frontend/eas.json ⏳ Needs staging profile

Architecture

feature/* → develop (staging) → main (production)
               │                    │
               ▼                    ▼
    tldr-summarizer-api-staging    tldr-summarizer-api
         (Fly.io)                      (Fly.io)
               │                    │
         Neon staging            Neon production
         Doppler staging         Doppler prod