Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/fly-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy Fly API

on:
push:
branches: [main]
paths:
- 'interview-app/**'
- '.github/workflows/fly-deploy.yml'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: fly-main
cancel-in-progress: true

jobs:
deploy:
name: Deploy interview-app to Fly
runs-on: ubuntu-latest
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_APP_NAME: ${{ vars.FLY_APP_NAME }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup flyctl
uses: superfly/flyctl-actions/setup-flyctl@master

- name: Deploy
run: |
if [ -z "${FLY_API_TOKEN}" ]; then
echo "Missing FLY_API_TOKEN secret; skipping deploy."
exit 0
fi

APP_NAME="${FLY_APP_NAME:-yappybara-api}"
echo "Deploying to Fly app: ${APP_NAME}"
flyctl deploy \
--remote-only \
--app "${APP_NAME}" \
--config interview-app/fly.toml.example
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ interview-app/.resume-context.md
interview-app/.conversation-backup.json
interview-app/last-fix.md
interview-app/build-summary.md
interview-app/builds/
interview-app/public/builds/
interview-app/fly.toml
interview-app/.fly/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ This repo includes a cheap static website in `site/` for `https://yappybara.dev`
Deploy docs: `docs/github-pages.md`
Distribution docs: `docs/distribution.md`
Fly API rollout docs: `docs/fly-api-rollout.md`
Fly CI deploy workflow: `.github/workflows/fly-deploy.yml`
Family launch docs: `docs/family-launch.md`
Deploy queue docs: `docs/deploy-queue.md`
Legal/supervision docs: `docs/legal-supervision.md`
Expand Down
16 changes: 16 additions & 0 deletions docs/fly-api-rollout.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ Smoke test:
curl -s https://yappybara-api.fly.dev/api/health
```

## GitHub auto-deploy

This repo includes `.github/workflows/fly-deploy.yml`.

On every push to `main` that touches `interview-app/`, GitHub Actions runs:

```bash
flyctl deploy --remote-only --config interview-app/fly.toml.example
```

Configure in GitHub:

1. Add repository secret `FLY_API_TOKEN`.
2. Optional: add repository variable `FLY_APP_NAME` if app name is not `yappybara-api`.
3. Ensure Fly app + volume already exist before first workflow run.

## Domain wiring

1. Keep root/apex (`yappybara.dev`) on GitHub Pages.
Expand Down
1 change: 1 addition & 0 deletions interview-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ build-summary.md
last-fix.md

# Generated content
builds/
public/builds/
uploads/*
!uploads/.gitkeep
Expand Down
1 change: 1 addition & 0 deletions interview-app/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ describe('Repository Hygiene', () => {
const appIgnorePath = path.resolve(__dirname, '.gitignore');
const appIgnore = fs.readFileSync(appIgnorePath, 'utf-8');
assert.ok(appIgnore.includes('certs/'));
assert.ok(appIgnore.includes('builds/'));
assert.ok(appIgnore.includes('apps.json'));
assert.ok(appIgnore.includes('data/'));
assert.ok(appIgnore.includes('uploads/*'));
Expand Down