Skip to content

Development & CI/CD

The two SiteCrate-owned repos (studio-website, sitecrate-admin) share the same development loop and the same CI/CD shape. Client repos do not — they deploy via the Netlify CLI (see Client delivery).

Terminal window
# Start a feature or fix
git checkout -b feature/my-change
# Make changes, then push and open a PR
git push origin feature/my-change
gh pr create --base main --title "Description" --body "What and why"
# GitHub Actions fires automatically:
# 1. Lint & Build (check) runs first
# 2. If it passes → deploy to staging + posts a PR comment with the URL
# Review on staging, then merge:
gh pr merge --squash
# Production deploys automatically after merge.

Both repos have two workflow files in .github/workflows/:

FileTriggerWhat it does
pr.ymlEvery PR to main (opened / updated / reopened)Two sequential jobs: check (lint + build) must pass, then deploy-staging deploys to staging and posts a PR comment. Rapid pushes cancel the in-progress run via a concurrency group.
deploy-prod.ymlPush to main (after merge)Builds with prod env vars → deploys to production.

Using needs: check inside pr.yml makes the staging deploy depend on lint + build passing. Separate workflow files cannot depend on each other — they always run in parallel, which would deploy broken code to staging even when CI fails. One file, two jobs, needs: check between them.

Configured per repo in GitHub → Settings → Secrets. Values are not shown here — this is the map of what each job consumes.

SecretUsed inPurpose
NETLIFY_AUTH_TOKENboth workflowsNetlify personal access token
NETLIFY_SITE_IDdeploy-prod.ymlProduction Netlify site
NETLIFY_SITE_ID_STAGINGpr.ymlStaging Netlify site
VITE_SUPABASE_URLallSupabase project URL (same for prod & staging)
VITE_SUPABASE_ANON_KEYallSupabase anon key (same for prod & staging)
VITE_SUPABASE_SCHEMA_STAGINGpr.yml deploy-staging jobValue staging — routes the staging app to the isolated schema

Everything above, plus:

SecretUsed inPurpose
SUPABASE_SERVICE_ROLE_KEYpr.yml, deploy-prod.ymlServer-side only (admin-users.js) — never VITE_-prefixed

Vite’s npm run dev does not run Netlify functions. To test send-email (or any function) locally, use:

Terminal window
netlify dev # local dev with Netlify functions wired up

See Environments & credentials for the full env-var map, and Email for the send-email function specifics.