Build environment variables
At the time your site is built, a number of special environment variables are exposed. You can access these environment variables with your build engine to customize your build (for instance, to add some special text to your site to show which branch has been built).
Default environment variables
When Pages builds your site it makes available the following environment variables:
|BRANCH||Github branch being built|
|OWNER||Owner of Github repository|
|SITE_PREFIX||Path of s3 bucket in which your site will be deployed|
|BASEURL||Path for deployed site|
Adding custom environment variables
Additional environment variables can be added to your builds by:
- Visit your site’s Site Settings -> Environment Variables
- Click “Add a new environment variable”
- Enter the name and value
- Click “Add” to save
You can remove environment variables by clicking the “X” button next to the desired environment variable in the Current Environment Variables table.
Certain environment variable names are reserved for Pages use and will be ignored. Warnings for any ignored environment variables will be present in the build logs. See above for an up-to-date list.
Pages is a FISMA Low system, do NOT store variables for systems that are Moderate or High, and only expose variables if it is safe to do so. You assume the risk if the values you add contain, or allow access to information that is not suitable for this categorization. See FISMA Security Categorization for more information on FISMA information categorization.