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
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,24 @@ jobs:
# Typechecks (tsc -b) and builds the production bundle.
- name: Client build
run: npm run build --prefix client

# Deploys to Render after the tests pass on a push to main, by calling the
# service's Deploy Hook (Render → Settings → Deploy Hook). Stored as the
# repository secret RENDER_DEPLOY_HOOK; without it this job does nothing.
# Only runs for pushes to main, never for pull requests, so the secret is
# never exposed to forks.
deploy:
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Trigger Render deploy
env:
RENDER_DEPLOY_HOOK: ${{ secrets.RENDER_DEPLOY_HOOK }}
run: |
if [ -z "$RENDER_DEPLOY_HOOK" ]; then
echo "RENDER_DEPLOY_HOOK secret not set; skipping deploy."
exit 0
fi
curl --fail --silent --show-error --max-time 30 -X POST "$RENDER_DEPLOY_HOOK" > /dev/null
echo "Render deploy triggered."
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ npm start # Express serves the API + the built client on :5273 (one proce

Note the port story is different between the two modes: in **dev**, the Vite client (`:5273`) and the Express API (`:3001`, proxied) are two separate processes that have to run side by side on different ports. In **production**, there's no Vite server at all. Express alone serves the built client and the API from a single process, and that's what defaults to `:5273` (override with the `PORT` env var).

### Deploying to Render

Every push to `main` runs the CI workflow (`.github/workflows/ci.yml`). Once the tests and build pass, its `deploy` job calls the Render service's **Deploy Hook**, so a broken build is never deployed. One-time setup: copy the hook URL from Render (**Settings → Deploy Hook**) into a GitHub repository secret named `RENDER_DEPLOY_HOOK` (**Settings → Secrets and variables → Actions**). Without the secret the job skips itself. If you use this, set Render's own Auto-Deploy to **Off** so a deploy isn't triggered twice.

### Tests

```bash
Expand Down
Loading