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.
Connect the repository
Section titled “Connect the repository”- In the Netlify dashboard, click Add new site → Import an existing project.
- Authorize GitHub and select the client repository.
- Netlify will detect the Astro project automatically. Verify the build settings:
- Build command:
pnpm run build - Publish directory:
.netlify(set by the Netlify adapter)
- Build command:
- 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.
Set environment variables
Section titled “Set environment variables”In the Netlify dashboard, go to Site configuration → Environment variables and add the same variables from your local .env:
GITHUB_TOKEN,GITHUB_OWNER,GITHUB_REPOSESSION_SECRETAUTH_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)SITE— pin to the custom domain (see below)
Pin SITE to the custom domain
Section titled “Pin SITE to the custom domain”Set SITE to the site’s custom domain:
SITE=https://acme.drawn.guideSITE 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.
Add a custom domain
Section titled “Add a custom domain”- In the Netlify dashboard, go to Domain management → Add a domain.
- Enter the client’s domain (e.g.
acme.drawn.guide). - Update the DNS records as prompted.
- 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.
Commit the lockfile
Section titled “Commit the lockfile”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.
Subsequent deploys
Section titled “Subsequent deploys”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.