Deploy
Goal: take the portal live. Two targets: Vercel (handles SSR/ISR natively) or a fully static export you can host anywhere.
Which target?
Use Vercel for portals that may grow server-side features, or any CKAN/SSR portal
that relies ongetServerSideProps. Use static for fully client-rendered portals
— GitHub Pages, Netlify, Cloudflare Pages, S3 + CloudFront, or plain nginx.
The AI path — /deploy
/deploy
/deploy auto-detects the target (a .vercel/ link or
output: 'export' in next.config.js), builds, verifies the build passes, and either
publishes to Vercel or produces a ready-to-upload out/ directory. It never reports
success on a failing build.
Force a target if you want:
/deploy --target static
The by-hand path
Vercel — Vercel builds on its own infrastructure, so no local build is needed:
npx vercel # preview
npx vercel --prod # production
Static export — set output: 'export' and images: { unoptimized: true } in
next.config.js, then build:
npm run build # writes the static site to out/
npx serve out # preview locally
Upload out/ to any static host:
npx gh-pages -d out # GitHub Pages
netlify deploy --dir=out --prod # Netlify
npx wrangler pages deploy out # Cloudflare Pages
Notes
- Dynamic routes under static export need
getStaticPathsreturning{ fallback: false }./add-datasetwrites one file per dataset specifically to avoid this; the catalog template pre-renders every manifest entry. - CKAN / SSR portals can't use static if they rely on API routes or
getServerSideProps— use Vercel. - Environment variables (e.g.
DMSfor CKAN portals) must be set in the Vercel dashboard or viavercel env add; for static export, inline client-side values at build time withNEXT_PUBLIC_*. - GitHub Pages subpath: if deploying to
https://user.github.io/repo/, also setbasePathandassetPrefixinnext.config.js.