Preview Environment
The preview environment is a shared environment that is used to test changes on Pull Requests. Each Pull Request is deployed to a unique path in the preview environment.
URL | https://docs-v3-preview.elastic.dev |
Terraform resources | https://github.com/elastic/docs-infra/tree/main/aws/elastic-web/us-east-1/elastic-docs-v3-preview |
The preview environment is an S3 bucket served by CloudFront defined by the elastic-docs-v3 terraform module.
Each repository has a GitHub Actions workflow that is triggered when a Pull Request is created. For example the docs-build.yml workflow on the elastic/elasticsearch repository. At it's core it uses the preview-build.yml reusable workflow to build and deploy the preview environment.
We are using OIDC to authenticate the GitHub Actions workflow to AWS. You can find a list of GitHub repositories that are allowed to deploy to AWS in the repositories.yml.
For each repository, we create a new IAM role that allows the GitHub Actions workflow of that repository to deploy to a specific path in the S3 bucket.
E.g. The GitHub Actions workflow for the elastic/kibana repository is allowed to deploy to the /elastic/kibana
path in the S3 bucket.