Can we access domain name within the build phases?

I would like to know whether there is a way to access the domain URL where the site build is getting deployed in any of the build phases(apart from reading it from the netlify config file)?

Hey @bravokeyl there are a number of ENV variables in the build system

Here is a comprehensive list https://gist.github.com/sw-yx/c53634e7e63f0015e43c16bc26832283

Sounds like you are looking for DEPLOY_URL, DEPLOY_PRIME_URL, or URL

Yes! Exactly what Iā€™m looking for.

1 Like