Skip to content
Patchwork
Start free
All docs pages

Docs · Start

Deploying

Vercel, Netlify, Cloudflare or a Node server, and the environment variables the site reads.

The pages are static. Only the forms run on the server, as Astro Actions, so the build needs an adapter for them. It picks one from the host it’s building on.

The host

Where it builds Adapter
Vercel Vercel, detected
Netlify Netlify, detected
Cloudflare Cloudflare, detected. Install its adapter first: pnpm add @astrojs/cloudflare
Anywhere else A Node server

DEPLOY_TARGET (node, vercel, netlify or cloudflare) overrides the detection. The code is in integrations/deploy-target.mjs.

Environment variables

Copy .env.example to .env for local work, and set the same variables at your host.

Variable What it’s for
SITE_URL Your domain, for the canonical addresses, the sitemap and the share images. Set it.
CONTACT_FORM_ENDPOINT Where the contact form sends to. See Forms.
NEWSLETTER_ENDPOINT, NEWSLETTER_API_KEY Where newsletter signups go.
PUBLIC_GA_MEASUREMENT_ID, PUBLIC_GTM_ID Google Analytics or Tag Manager, if you use them.
PUBLIC_CONSENT_ENABLED, PUBLIC_PRIVACY_POLICY_URL The cookie consent banner, when analytics is set up.
GOOGLE_SITE_VERIFICATION, BING_SITE_VERIFICATION Search console verification.

Secrets go in the host’s environment settings, never in the repository.

Before you deploy

Run pnpm validate. It runs lint, the type check, the unit tests and the build, and ends with the agent-ready check, which lists broken links, words still missing from the translations, inline scripts the Content Security Policy would block, and placeholders left in the copy.