Deploying github repository branches as subdomain with /branch_name using netlify

I deployed a code for documentation written in md format which gets deployed as HTML pages. So main repo (master) from github gets deployed as the site and the branches also .

Domain : maskingdocs.ops.delphix.com

Domain for branch: dlpx-6-0-1-0.maskingdocs.ops.delphix.com

How i want is branch domain should be like maskingdocs.ops.delphix.com/branch_name instead of branch_name.maskingdocs.ops.delphix.com .

Example : maskingdocs.ops.delphix.com/dlpx-6-0-1-0

Branches should get deployed like this.

Any clues how this could be achieved , some addon or plugin.

What you’re looking for is not possible. The reason? You’re trying to deploy inside a directory of a website and because the way Netlify deploys, you can’t add just one file or folder. You need to re-upload the entire website everytime.

Branches on the other hand can also be orphan and might not have any connection with the main branch. Also, they would be built independently than the main branch. Thus, it won’t be possible to publish it to the main branch.

You’ve 2 options:

  1. Build locally and organise the project structure like you want and then upload it.
  2. Use proxy redirects to setup a redirect that will show dlpx-6-0-1-0.maskingdocs.ops.delphix.com at maskingdocs.ops.delphix.com/dlpx-6-0-1-0. Read here: Rewrites and proxies | Netlify Docs
1 Like