skills/render-static-sites/SKILL.md
Deploys and configures static sites on Render's global CDN—build commands, publish paths, SPA routing, redirects, custom headers, and PR previews. Use when the user needs to deploy a static site, set up a React/Vue/Hugo/Gatsby frontend, configure SPA fallback routing, add redirect rules, customize response headers, or choose between a static site and a web service for their frontend. Trigger terms: static site, CDN, SPA, single-page app, React deploy, Vue deploy, Hugo, Gatsby, Docusaurus, Jekyll, staticPublishPath.
npx skillsauth add render-oss/skills render-static-sitesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Deploys static frontends (React, Vue, Hugo, Gatsby, Docusaurus, Jekyll, etc.) to Render's global CDN with automatic TLS, Brotli compression, HTTP/2, and DDoS protection. Free tier available.
For SSR frameworks (Next.js, Nuxt, SvelteKit) that need a running server, use render-web-services instead. For Blueprint authoring, see render-blueprints.
| Need | Use | Why |
|------|-----|-----|
| Pure HTML/CSS/JS, SPA, docs, blog | Static Site | Free, global CDN, instant cache invalidation |
| SSR (Next.js next start, Nuxt server) | Web Service | Needs a running Node/Python/etc. process |
| Static export from SSR framework | Static Site | If the framework supports full static export (next export, nuxt generate) |
| API backend | Web Service | Static sites cannot run server code |
Key constraint: Static sites are not on the private network. They cannot communicate with other Render services over internal hostnames.
| Setting | Purpose |
|---------|---------|
| buildCommand | Installs dependencies and builds assets (e.g. npm ci && npm run build) |
| staticPublishPath | Directory of built output to serve (e.g. build, dist, public) |
Render auto-detects and installs dependencies. Set SKIP_INSTALL_DEPS=true to handle installation yourself in the build command.
| Framework | Build command | Publish path |
|-----------|--------------|--------------|
| Create React App | npm ci && npm run build | build |
| Vite (React/Vue/Svelte) | npm ci && npm run build | dist |
| Next.js (static export) | npm ci && next build | out |
| Nuxt (static) | npm ci && nuxt generate | .output/public |
| Hugo | hugo --minify | public |
| Gatsby | npm ci && gatsby build | public |
| Docusaurus | npm ci && npm run build | build |
| Jekyll | bundle exec jekyll build | _site |
| Astro | npm ci && astro build | dist |
Single-page apps need a catch-all rule so the CDN serves index.html for all routes instead of returning 404.
Configure Redirect/Rewrite Rules in the Dashboard (Settings > Redirects/Rewrites) or via the Blueprint routes field:
routes:
- type: rewrite
source: /*
destination: /index.html
For multi-path redirects (e.g. old blog URLs), add specific rules above the catch-all so they take priority.
See references/routing-and-headers.md for redirect types, header rules, and caching patterns.
Add security and performance headers from the Dashboard (Settings > Headers) or the Blueprint headers field:
headers:
- path: /*
name: X-Frame-Options
value: DENY
- path: /assets/*
name: Cache-Control
value: public, max-age=31536000, immutable
Static sites support automatic PR previews—each pull request gets a unique URL with the built site.
previews.generation to automatic or manual<service>-<pr-id>.onrender.comservices:
- type: web
runtime: static
name: my-frontend
buildCommand: npm ci && npm run build
staticPublishPath: dist
routes:
- type: rewrite
source: /*
destination: /index.html
headers:
- path: /*
name: X-Frame-Options
value: DENY
previews:
generation: automatic
Note: Static sites use type: web with runtime: static in Blueprints. There is no separate type: static.
Static sites have a free tier. They count against workspace-level monthly included amounts for:
| Document | Contents |
|----------|----------|
| references/routing-and-headers.md | Redirect types, rewrite rules, header patterns, SPA config |
| references/framework-configs.md | Build commands and publish paths for 10+ frameworks |
render.yaml schema for static site fieldsdevelopment
Configures Render web services—port binding, TLS, health checks, custom domains, auto-deploy, PR previews, persistent disks, and deploy lifecycle. Use when the user needs to set up a web service, fix health check failures, add a custom domain, configure zero-downtime deploys, or troubleshoot port binding issues.
tools
Scales Render services—configures autoscaling targets, chooses instance types, sets manual instance counts, and optimizes cost. Use when the user needs to handle more traffic, set up autoscaling, pick the right instance type, reduce costs, or troubleshoot scaling behavior like slow scale-down or stuck instances.
development
Configures Render private services—internal-only apps that accept traffic exclusively from other Render services over the private network. Use when the user needs an internal API, microservice, gRPC server, sidecar, or any service that should not be publicly accessible. Also use when choosing between a private service and a background worker. Trigger terms: private service, pserv, internal service, internal API, microservice, gRPC, not public, private network service.
tools
Sets up and optimizes Managed PostgreSQL on Render—connection strings (internal vs external), creation constraints, storage autoscaling, connection limits, high availability, read replicas, backups, and MCP inspection. Use when the user mentions Postgres, PostgreSQL, Render database, connection string, DATABASE_URL, backups, snapshots, replicas, HA, disk storage, connection pooling, or troubleshooting DB connectivity.