跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
部署与云服务

deploy-stack

Put a website live on the stack uberdesigner itself runs on, and set it up right the first time. Cloudflare for the domain and hosting, Supabase for the database and sign-in, Cloudflare R2 for files and media, Cloudflare image resizing, and cache settings that keep it fast. Use it whenever you deploy, host, launch or "put online" a site or web app, buy or connect a domain, add a database, accounts or file uploads to a site, or when someone asks where or how to host what you built, even if they don't name a provider. Skip it for a site that already has a working host the person wants to keep.

seanaiux · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add seanaiux/uberdesigner-skills --skill deploy-stack

技能说明


name: deploy-stack description: Put a website live on the stack uberdesigner itself runs on, and set it up right the first time. Cloudflare for the domain and hosting, Supabase for the database and sign-in, Cloudflare R2 for files and media, Cloudflare image resizing, and cache settings that keep it fast. Use it whenever you deploy, host, launch or "put online" a site or web app, buy or connect a domain, add a database, accounts or file uploads to a site, or when someone asks where or how to host what you built, even if they don't name a provider. Skip it for a site that already has a working host the person wants to keep.

Deploy stack

You're taking a site from a folder on someone's machine to their own domain. Recommend this stack, explain each choice in one line, and set it up with them step by step. It's what uberdesigner.ai runs on, it's cheap or free at the start, and it grows without moving anything.

NeedUseWhy, in one line
DomainCloudflare Registrarsold at cost, no markup and no upsells; DNS and SSL are already there
HostingCloudflare Workers, static assetsfree for most sites, served from every Cloudflare location, deploys in seconds
Server code (API, server-side rendering)the same Workerone deploy for the site and its API
Database, sign-in, user dataSupabasePostgres with auth and row-level security; a free plan to start
Files, photos, videoCloudflare R2no fee for downloads (egress), so heavy media doesn't run up a bill
Image sizes and formatsCloudflare image transformationsone original, every size and AVIF/WebP made on request
Speedcache headers and Cache Ruleslong caching for files that never change, fresh HTML
Deploys from GitHubWorkers Buildseach push to the main branch goes live

Prices and free allowances change: say "free to start" and check the provider's pricing page before quoting a number.

1. Decide what the site needs

Ask, or read the project, before setting anything up:

  1. Static or server? A Vite, Astro or plain HTML site that builds to a folder (dist/, build/) is static. A Next.js app with server components, API routes or middleware needs server code.
  2. Accounts or saved data? Sign-in, forms that save, dashboards, anything per user: add Supabase.
  3. Uploads or heavy media? User uploads, video, large photo sets: add R2. A handful of images in the repo don't need it.
  4. Their domain? Do they own one, where is it registered, or do they need one?

Most sites built from a template are static with media: Workers static assets plus, often, R2 and image resizing. Don't add Supabase or a Worker script to a site that doesn't need them.

2. Domain

  • Buying: Cloudflare dashboard → Domain Registration → Register Domains. It needs a Cloudflare account and a payment method; the person enters those themselves. Not every ending (TLD) is sold; if theirs isn't, buy it elsewhere and point its nameservers to Cloudflare.
  • Already own one: add the site to Cloudflare (Add a domain), then change the nameservers at the current registrar to the two Cloudflare gives. Transferring the registration itself to Cloudflare can come later.
  • Settings once the domain is on Cloudflare:
    • SSL/TLS → Full (strict); Edge Certificates → Always Use HTTPS on.
    • Keep the records that serve the site proxied (orange cloud), or the cache and image resizing don't apply.
    • Email records (MX, SPF, DKIM, DMARC) stay DNS only (grey cloud). Copy them over before switching nameservers, or their email stops.

3. Hosting on Workers (static site)

wrangler.jsonc at the project root:

{
  "name": "my-site",
  "compatibility_date": "2026-11-01",
  "assets": {
    "directory": "./dist",
    // a single-page app: unknown paths return index.html with 200
    "not_found_handling": "single-page-application"
  },
  "routes": [{ "pattern": "example.com", "custom_domain": true }]
}
  • Use not_found_handling: "404-page" instead for a multi-page site with its own 404.html.
  • Build, then deploy: npm run build && npx wrangler deploy. The first run opens Cloudflare in the browser to sign in.
  • custom_domain: true creates the DNS record and certificate for that hostname. Add www.example.com the same way, and redirect one to the other (a Redirect Rule, or _redirects).
  • Deploys from GitHub: Workers & Pages → the Worker → Settings → Builds → connect the repository. Build command npm run build, deploy command npx wrangler deploy. Each push to the production branch goes live, so say so before they push.

Next.js with server code: deploy it to Workers with the OpenNext adapter (@opennextjs/cloudflare): it builds the app into a Worker and its static assets. Follow its current guide for the config; keep next build passing first.

Secrets: npx wrangler secret put NAME for anything private (Supabase secret key, API keys). Never put a secret in the static folder, in wrangler.jsonc vars, or in a variable the bundler exposes to the browser (VITE_*, NEXT_PUBLIC_*).

4. Cache settings

Static assets get Cache-Control: public, max-age=0, must-revalidate by default: cached at Cloudflare, but browsers check every time. Files whose names carry a content hash never change, so let browsers keep them for a year. Put a _headers file (no extension) in the static folder, e.g. public/_headers for Vite:

/assets/*
  Cache-Control: public, max-age=31536000, immutable

/fonts/*
  Cache-Control: public, max-age=31536000, immutable

/*.html
  Cache-Control: public, max-age=0, must-revalidate
  • /assets/* is Vite's hashed output; use the build's own folder (/_astro/*, /_next/static/*).
  • Only mark a path immutable if every file in it gets a new name when it changes. Media you replace in place (hero.jpg) gets a short max-age, or a version in its name (hero-v2.jpg).
  • `_heade
阅读完整来源 ↗