Multiple contexts for single branch

Hi there!

I’m currently setting up my workflow for https://sursen.netlify.app/ and I have some questions regarding multiple contexts for the same branch.

What I want to achieve is basically have two environments based on my main branch. The first should be a staging env, which will be deployed automatically, and the other should be our production env, which will be deployed manually from the netlify ui.

The staging could either be accessed through a custom domain or the netlify domain, that’s not a pressing issue. The production env will be accessed through our custom domain.

The two environments will be targeting two different versions of our backend (currently set through env vars in netlify.toml).

Does anyone know if this is possible? It feels like I’m either missing something obvious, or trying to do something fundamentally against the netlify way (e.i. breaking 1 branch = 1 behaviour).

Thanks in advance
Lasse

@Lasse-Fisker Welcome to the Netlify community.

Does this help?

Hi @gregraven, thanks for the reply

Unfortunately I don’t think so. I cannot see anything regarding multiple contexts on a single branch? (or how to achieve the setup specified above).

Hey there, @Lasse-Fisker :wave:

Thanks so much for reaching out, and welcome to the Netlify Forums :netliconfetti:

This is a good question. At this time, having multiple contexts on the same branch is not possible. You can read more about contexts and file based configuration in the Netlify docs!