The environment variables below allow you to configure features of Gatsby Cloud:
NODE_VERSION: Specify the version of Node.js your project should use. For example,
NODE_VERSION=10. Defaults to
NPM_TOKEN: Use to access private npm modules.
NPM_REGISTRY: Use to set the URL of a private registry.
YARN_FLAGS: Flags that are passed through to the
NODE_OPTIONS: Passed through as options for Node.js. For example,
PREFIX_PATHS: Set to
trueto enable the
gatsby build. See the docs on prefix-paths.
REACT_PROFILE: Set to
1to enable the
gatsby build. See the docs on using the profiler.
These variables are pre-defined for both Builds and Preview environments. They are set automatically and cannot be changed. You can reference them in your
gatsby-config.js or anywhere else you would normally reference an environment variable.
BRANCH: The name of the current git branch. Useful for swapping environment variables depending on the branch.
COMMIT_REF: The commit SHA that the build is building off of. Can be used with tools like Sentry for creating unique deployment IDs.
true. Useful for checking if your build is running on Gatsby Cloud.
trueonly in the CMS Preview environment, for both legacy preview builder and incremental preview builder.
productionfor Production Builds and Pull Request Builds
developmentfor CMS Previews which use the legacy preview builder
productionfor CMS Previews that use the new incremental preview builder
- Regardless of the environment variable value, CMS Preview builds still use preview data
Is there a way for me to know what will be the URL of the deployed build for a pull request ?
I was looking for an env variable, but it could be something else ?
While there isn't a way to predetermine a PR build's individual build UUID - the most recently completed build on a PR branch will always have the URL:
Please sign in to leave a comment.