Create preview deployment without a hosting provider

Our team would like to be able to generate preview deployments. We don't need a hosting provider for our app, so we're not using Vercel or Netlify. We want to be able to generate our own preview deployments, but the docs aren't clear on how to do this and AI doesn't help either. I realize preview deployments is in beta, but we don't need a lot of handholding, we just need a bit more info. We have already tried setting CONVEX_DEPLOY_KEY and running npx convex deploy --preview-create {branch-name}. We get a prompt asking if we want to "push your code to your prod deployment", which is not what we want. We tried configuring an .env.preview and the running npx deploy with the --env-file option, but we don't seem to be getting the configuration quite right. It would be awesome if the docs included configuring a GitHub action for preview deployments. 🔥 Any guidance is appreciated, thanks!
5 Replies
Convex Bot
Convex Bot•3d ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
jamwt
jamwt•2d ago
hi. CONVEX_DEPLOY_KEY is set to a preview key generated by your dashboard? we'll update the docs to talk about generating preview deploy keys independent of the vercel/netlify pages -- this is a good point
jamwt
jamwt•2d ago
Using Convex with Vercel | Convex Developer Hub
Host your frontend on Vercel and your backend on Convex.
jamwt
jamwt•2d ago
if you generate a preview deploy key, and that's what's in the environment when you deploy, it should recognize the key as a preview type and spin up a preview deployment that's how things are working in vercel and netlify
Tony @ Fantastic Realms
Tony @ Fantastic RealmsOP•21h ago
@Jamie Thank you! I just realized I had it working yesterday, but had compounded errors by not uploading assets needed to storage and using the .cloud instead of .site url (our entry point is an http action). But this is great now; we're able to deploy to dev, prod, and now branch-based preview environments. Thanks for getting back to me and motivating me to hack on a solution a bit more.

Did you find this page helpful?