DocsSchema ReferenceEnvironment Configuration

Environment Configuration

Configure deployment behavior, service grouping, and automation for ephemeral environments

The environment section controls how Lifecycle deploys and manages your ephemeral environments. It defines which services are deployed by default, which are optional, and how automation (webhooks) should behave.

Fields Reference

FieldTypeRequiredDescription
autoDeploybooleanNoAutomatically deploy on PR updates
defaultServicesarrayYesServices deployed with every environment
optionalServicesarrayNoServices available on-demand
webhooksarrayNoAutomation triggers on state changes
enabledFeaturesarrayNoFeature flags for the environment
githubDeploymentsbooleanNoCreate GitHub deployment records
useGithubStatusCommentbooleanNoPost status comments on PRs

defaultServices

Services listed in defaultServices are deployed automatically when an environment is created. At least one default service is required.

Service Reference Fields

Each entry in defaultServices can include optional fields to override the service configuration:

FieldTypeDescription
namestringRequired. Name matching a service in the services array
repositorystringOverride the repository for this service
branchstringOverride the branch for this service
serviceIdnumberInternal service ID reference

optionalServices

Services listed in optionalServices are not deployed by default but can be added to an environment on-demand through the Lifecycle UI or API.

Optional services are useful for components that aren’t always needed, like background workers, caching layers, or additional databases for specific testing scenarios.

autoDeploy

When autoDeploy is enabled, Lifecycle automatically triggers a deployment whenever the PR is updated (new commits pushed).

With autoDeploy: true, environments are created automatically on every commit to the PR branch without requiring manual label addition.

webhooks

Webhooks allow you to trigger external actions when the environment reaches certain states. See the Webhooks page for detailed configuration.

Examples

The minimal configuration requires only defaultServices: