Setting Branch Subdomain for Manual Branch Deploys

Hello,

My team is using custom Jenkins pipeline for build process and deploys to Netlify by using netlify-cli.
Latest version added support for manual branch deploys (which was a very expected feature). Now we are facing an issue regarding branch subdomains. Setting up a branch subdomain is pretty much straightforward when site is linked to GitHub repo and this option is available inside domain settings on app.netlify.com. However, when site isn’t linked to a repo and manual (branch) deploys are used, there is no such options inside mentioned UI.
Let’s say we have a site domain:
test.myteam.net
For staging branch that’s deployed manually we get staging--test.netlify.app, and we would like to have staging.test.myteam.net as well.

I have looked through API reference but can’t seem to find an option for setting branch subdomain through it.

Are there plans for adding this option to API, Netlify CLI or Netlify UI for sites that aren’t linked to a repo?

2 Likes

Hey @Lanchi, thanks for bearing with! I’ll call upon an expert. No pressure :face_with_hand_over_mouth:!

@raeesbhatti, would you be able to offer any insight in to whether this is possible or plausible?

I’m not Raees, but can you tell us your real URL @Lanchi, that has the manual branch deploy? I wouldn’t expect it to work in our UI as you do, but I’d be happy to test and see if it is possible to make it work in some other way, just need to see your specific site rather than a fake placeholder URL to look more deeply into.

Hello @fool, You can check it out on manual-example.netlify.app that has manual-example.lanchi.dev set as custom domain and one manual deploy for staging branch performed with
netlify deploy --site=${siteID} --branch=staging command.
So basically I wish to have https://staging.manual-example.lanchi.dev pointing to the latest https://staging–manual-example.netlify.app/ deployment but I can’t set it in the UI since the site isn’t connected to GH repo.

Thanks. Seems we are missing substantial support on the back end for this being configured in a way that it would work as a branch subdomain, so you’ll be limited to its individual permalink to get to it. I guess you probably know this, but in case you didn’t, ever deploy has a permalink which is described as $DEPLOY_URL during build, and is mentioned in the webhook notifications we send specifically, and is finally available via API and UI. Here’s a screenshot of where the link can be found in the UI from a deploy listing page:

I’ll get some feature requests filed to improve that support, but TL;DR these won’t be available as branch deploys without some significant work which the product team will have to decide if we’ll implement. I don’t see it happening in the immediate future based on other priorities, but I do not make the decisions, so please do sound off here about the importance of this feature in your workflow as they will review this thread while considering!

Hi @fool,

I just want to give an additional +1 here. I have two projects, one is using GitHub Actions and one Azure DevOps, that build and deploy from there with netlify-cli instead of Netlify’s build mechanism and would also like to use custom domains for branch deploys :v:

I’d recommend mentioning your use case in the issue directly so the people who must need to can hear it there :slight_smile: We link community threads to issues like that, but those links look the same whether there is one or one hundred people sounding off there; our product team is most likely to see the number of comments in the issue when they are made on the issue directly:

2 Likes