Open Sceat opened 4 years ago
Apparently, it's not possible to do so: Setting Branch Subdomain for Manual Branch Deploys
My workaround for this right now is something like this:
"scripts": {
"deploy": "cross-env BRANCH=$(git symbolic-ref --short HEAD) USER=\"$(git config user.name)\" yarn deploy:branch",
"deploy:branch": "cross-env-shell yarn build && netlify deploy --dir dist --open --alias $BRANCH --message \"A new local branch deploy from branch $BRANCH by $USER.\"",
},
So I just run yarn deploy
in the command line to kick off a Netlify build that uses the current branch name as the alias. It works ok, the problem that I'm noticing are the unpredictable URL's.
Some examples:
Alias | Result |
---|---|
feature-5345-cm-icon-picker | Not found |
iconpicker | Not found |
icon-picker | Successful |
I have no idea why the first two don't work, but the last one with a dash in it worked just fine. I haven't been able to figure out the pattern for what makes a successful URL. I'm currently in contact with support, so I'll report back any findings. If anyone else has any ideas, please let me know!
I would also like to point my domain to the aliased branch deploy
adding a +1 for this as it would be a major help to our current workflow!
We are also looking for support in this regard! We are using cli deploys because (1) we can check logs faster, (2) we can add additional checks in pipelines (e.g. Sonar scanning) and (3) we are migrating to Trunk Based Development, so we are using the main branch for development and we create separate release branches, all of the logic being handled inside GitHub Actions. Having custom domains in branch deploys (even just setting up some hardcoded ones manually is fine) would help a lot.
Do we have any update on this request? Maybe if there has been any progress on the backend side at least? Not sure who to ping, @erezrokah @khendrikse
this would be great, we could also use this
+1 for this. My team moved to Netlify DNS for this feature but unexpected when it only apply to netlify.app domain (build then deploy with alias)
I think it is the most common feature request.
Feature request
Now that we can branch deploy through the cli #275 , how can we add a domain on the generated
https://<branch>--<app name>.netlify.app/
?