Branch deploy settings for DEPLOY_PRIME_URL


My site default subdomain is:

The primary domain is is set to automatically redirect to

I have setup a CNAME to support a branch deploy of the staging branch: is an alias for

My branch deploy command is:

  command = "npm run build -- -b $DEPLOY_PRIME_URL"

Is there a way to configure netlify such that when it goes to deploy the staging branch, it sets DEPLOY_PRIME_URL to rather than It would be a way to define the primary domain mapping for the staging branch, much like we configure for the main branch.

Thank you for your help.

Hi @mhite,

$DEPLOY_PRIME_URL will always have the .netlify URL. But since you simply want to change the -b argument, why not use:

  command = "npm run build -- -b"

Yes, I could hard code it. Was wondering if there is a more extensible way that could work with multiple branches potentially.

Just a follow-up. Ended up doing this:

  command = "npm run build -- -b https://$"
1 Like