Manually deploy to specific context

I am just curious to know if it is possible to manually deploy a site to a specific context.

We have a couple of sites on Netlify. One is our main site, and the other is accessed, via rewrite, through a pathname on the main site.

The proxied site uses the git deployment mechanism, which is great. With it I can make changes to, say, the development branch, and be able to see those changes after it builds. However, to test it properly, and in the specific context that it needs, you must go through the main site.

What I want to be able to do is test changes on the proxied site through the main site. This means the main site will need to be rebuilt to use the development prefix of the proxied site, but I don’t want that change to be pushed to production until we’re ready. This would be easy enough to do if the main site were using git deployments, too, but it’s not. The main site is built on Gatsby Cloud and deployed using their Netlify integration, so (I’m assuming) it is using a manual deployment.

I haven’t been able to find a way to manually deploy a site to a different context. Is there a way that I’m just missing? If there is a way to do that, then I’m sure Gatsby Cloud could be updated to use it. That would solve the problem quite nicely.

Not sure what you consider to be a “manual” deploy - we consider them to be any deploy not made from git (so, CLI, API, or drag and drop). Could you tell us how you manually deploy?

If CLI, I’ll recommend using the “draft” deploy option - that makes a preview that you can use that isn’t published live, with whatever proxy you like. Of course you’ll want to make sure you don’t accidentally publish such a deploy later!

A draft deploy sounds like exactly what I need.

We currently use Gatsby Cloud to build, which deploys via the Netlify integration, so I’m assuming they use CLI or API. I will speak with the Gatsby team about how their integration works, and if it can be extended to implement a draft deploy.

Sounds like a plan! The API call change is likely very small:

setting "draft": true

in this call: Netlify API documentation

1 Like