Skip to content

Deploying to Netlify

Portal sites deploy to Netlify as SSR sites using the Netlify adapter. Each client site is its own Netlify site connected to its own GitHub repository.

  1. In the Netlify dashboard, click Add new site → Import an existing project.
  2. Authorize GitHub and select the client repository.
  3. Netlify will detect the Astro project automatically. Verify the build settings:
    • Build command: pnpm run build
    • Publish directory: .netlify (set by the Netlify adapter)
  4. Click Deploy site.

The first build will fail if env vars are not yet set. Set them before deploying, or trigger a new deploy after setting them.

In the Netlify dashboard, go to Site configuration → Environment variables and add the same variables from your local .env:

  • GITHUB_TOKEN, GITHUB_OWNER, GITHUB_REPO
  • SESSION_SECRET
  • AUTH_PROVIDER (if using Supabase)
  • SUPABASE_URL, SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY (if using Supabase)
  • ADMIN_PASSWORD, EDITOR_PASSWORD, viewer passwords (if using password mode)
  • SITEpin to the custom domain (see below)

Set SITE to the site’s custom domain:

SITE=https://acme.drawn.guide

SITE is used by invite and password-reset emails to build absolute URLs. Netlify’s built-in URL variable can resolve to the *.netlify.app subdomain instead of the custom domain — so an explicit SITE is required. The provisioner sets this automatically for new sites; for existing sites, add it manually.

  1. In the Netlify dashboard, go to Domain management → Add a domain.
  2. Enter the client’s domain (e.g. acme.drawn.guide).
  3. Update the DNS records as prompted.
  4. Wait for the domain to become primary (shown as “Primary domain” in the Netlify dashboard).

Once the custom domain is primary, Netlify’s URL variable resolves correctly and OAuth redirect flows work as expected.

Netlify installs dependencies with a frozen lockfile (pnpm install --frozen-lockfile). The committed pnpm-lock.yaml is the source of truth for what gets installed — always commit it alongside package.json whenever you update dependencies.

If you forget to commit the lockfile after an update, the Netlify build will fail with a lockfile mismatch error.

Push to the main branch to trigger a new Netlify build and deploy. No additional configuration is needed — Netlify rebuilds the site automatically on every push to main. The client template does not include its own CI workflows; automated tests and linting live in the framework monorepo, not the client repo.

See Updating packages for how @drawnagency package updates reach the site.