I have set up netlify with a custom domain - so far so good - but I was wondering is it possible to automatically do a Branch deploy to a custom domain?
Currently if I push a branch to my repository, the branch is deployed at https://<GIT_HASH>--infarm-dev.netlify.com. Is it possible for the branch to automatically be deployed to https://<BRANCH_NAME>.infarm.dev? Currently I have to go to the domain management in the settings and manually add it, which I would like to avoid.
The last successful build of your branch (usually that corresponds with your last commit on that branch) will be automatically served at branchname.yourcustomdomain with no further action by you; we serve as soon as it is built. The only challenges are 2:
in the SSL certificate. If you already have an SSL certificate (which you do for *.infarm.dev, see here: Netlify App) then this is not a blocker.
then you just need to add the DNS records, which you could do in advance (add every branch name preemptively here: Netlify App), or you could set some “default” *.infarm.dev record as a CNAME pointing to yoursitename.netlify.com and then automatically, branchname.infarm.dev will map to the right place and “just work”
I added the *.infarm.dev CNAME record as you suggested and I am now able to access my deployed branches by their names, without having to do any extra steps in the UI, which is great.
The only thing is that the Preview deploy link on the builds page still links to the url on the netlify subdomain 5e79debc13cbf20008d0bbce--infarm-dev.netlify.com. Is there any way to change that or is that the kind of thing I should be making a feature request for?