I’m trying to setup my Nuxt 3 and Storyblok website. In THEIR docs they suggest making a static site for a Preview environment and a static site for a Production environment.
The thing is, those sites are almost exactly the same.
They use the same repo.
The only differences are:
They each have their own webhook
They each have their own environment variables.
My question is:
Do I REALLY need 2 Netlify sites for this? Or is there a way I can just put them to different preview links with different environment variables?
Ideally it’s just one webhook but different environment variables, but some way to manage this in 1 site.
@ZackPlauche They absolutely deal with multiple git branches.
I might be misunderstanding your request, but I interpreted it as wanting both the “preview” and “production” to exist in the one “site”, where I’m interpreting “site” as the site instance within your Netlify account (not literally existing superimposed at the same deployed URL).
My thinking was that you could potentially leverage a branch deploy, of the same code, where the environment variables responsible for outputting ‘preview’ are applied to that branch context.
@ZackPlauche Yes, I mean an additional branch in the repository.
Not because it needs different code, just to take advantage of the branch deploys and context.
I mean:
1 Github Repo (2 x branches, your main and your ‘preview’ branch)
1 Site in Netlify
Settings mostly shared but with environment variables for each deploy context
But it’s also the only way I’m aware of that could answer your original request/questions:
Do I REALLY need 2 Netlify sites for this?
Or is there a way I can just put them to different preview links with different environment variables?
It’s not really a workflow for your precise situation, usually it’d be used for previewing development branches, or staging where the code has diverged.
You may find it easier to have them configured as separate site instances in Netlify.
It’s also entirely possible Netlify’s staff know of some other way.
Having 2 sites is the easier way out here. If you want to complicate things, it could be possible to merge all of it in a single site, but I don’t see the value in that. If you’re really desperate for that, let us know.