Unlock seamless workflows and faster delivery with our latest releases – get the details

How do I Deploy Sanity and Next.js (to Vercel) when they Live in a Top Level Folder Side by Side?

13 replies
Last updated: Oct 1, 2021
Hello thereHow do I deploy Sanity & NextJS (to Vercel) when they live in a top level folder side by side? ie

- my-project
-- studio
-- web
Oct 1, 2021, 11:24 AM
In the past I’ve deployed a solution where Sanity lived inside a NextJS app, that was easy enough.
Oct 1, 2021, 11:24 AM
I’m now dealing with Sanity and NextJS living at the same level inside a top level folder like on https://github.com/SimeonGriggs/sanity-nextjs-preview
Oct 1, 2021, 11:24 AM
do I need to have two repositories living inside a third one?
Oct 1, 2021, 11:24 AM
do I deploy the top level one or Sanity and NextJS individually?
Oct 1, 2021, 11:24 AM
is there any documentation/blog/case study I can reference to?
Oct 1, 2021, 11:24 AM
deploy your next app from the web folder, and the studio from the studio folder
Oct 1, 2021, 12:02 PM
in vercel, you need to specify that the
web
folder is your project root.
for sanity, navigate to your studio folder and run
sanity deploy
Oct 1, 2021, 12:10 PM
hi
user U
thanks for getting back to me
Oct 1, 2021, 12:13 PM
does it mean I need to have two separate repos in github then?
Oct 1, 2021, 12:13 PM
nope, you can have a single repo 🙂
Oct 1, 2021, 12:14 PM
github.com/selbekk/selbekk-io is my website, and a good example of doing stuff this way 🙂
Oct 1, 2021, 12:14 PM
that’s awesome 👍 thanks for sharing, that’s insightful 🤓
Oct 1, 2021, 12:15 PM
🙂 you're welcome!
Oct 1, 2021, 12:17 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?