RenderExperimental
Deploy to Render with one command, built from your Git repository; the database comes from your provider.
In a project with deploy render (CLI 0.29.0 or newer), pnpm clubedge deploy uses Render's API with an API key:
pnpm clubedge add deploy render # if the project deploys elsewhere today
pnpm clubedge deployBefore you start
- Push the project. Render builds the
Dockerfilefrom your Git repository, not from your machine. Theoriginremote must be on GitHub, GitLab, or Bitbucket, and the current branch pushed;deploystops when it isn't, and warns about commits that aren't pushed yet. - Give Render access to the repository, in the dashboard under your account's Git settings. Render can't build a repository it can't read.
- Put
DATABASE_URLin.env.production: Render Postgres, Neon, or Supabase.deploycreates no database on Render.
What it does
- Signs in with an API key. With
RENDER_API_KEYset, it uses that. Otherwise it opens the dashboard's API keys page and asks you to paste a key; it doesn't store it, so setRENDER_API_KEYto skip the question next time. With several workspaces, it asks which one. - Creates or reuses the web service, named after the package, as
render.yamldescribes it: the Docker runtime on a starter instance,node /app/migrate.mjsas the pre-deploy command, the/api/healthcheck, and a new deploy on each push to the branch. - Sets the production variables: the env file's values, the service's
*.onrender.comURL asAPP_URLandNEXT_PUBLIC_APP_URL,CLIENT_IP_HEADER=cf-connecting-ip, where the client's address is (CLI 0.42.0 or newer), and with Better Auth a generatedBETTER_AUTH_SECRETthat later runs keep. On an existing service, it changes only the values that differ. - Deploys and waits until Render reports the release live: Render builds the image, runs the migrations before the release, and checks
/api/health. The first build takes several minutes. - Fixes the public URL. When Render gives the service another subdomain (the name was taken),
deploysets that URL, cancels the deploy that creating the service started, and deploys again, since Next.js compiles the URL into the build.
Costs
deploy creates the service on Render's starter instance type, which Render bills monthly: pre-deploy commands, which run the migrations before each release, need a paid type. For the free type, create the service yourself from the Blueprint without preDeployCommand, and run the migrations yourself.
When a deploy fails
deploy prints the status the deploy ended with (build_failed, pre_deploy_failed, update_failed) and the service's dashboard link, where the build and deploy logs say why. A pre_deploy_failed is a failed migration: check DATABASE_URL. Fix the cause and run deploy again, which reuses the service.
To set up Render without this command, see Render in the deploy guide.
How is this guide?