Auto-deploy and labels
Automatically deploy pull request Environments and control them with configurable GitHub labels.
Configure auto-deploy
To deploy automatically when a pull request opens, set autoDeploy in the
repository’s lifecycle.yaml file:
- Lifecycle creates the Environment when a pull request opens.
- Lifecycle adds the configured deploy label. Its default name is
lifecycle-deploy!.
Manage deployments with labels
If auto-deploy is not enabled, you can manually control the Environment using pull request labels. The names below are defaults. Ask your deployment owner for the configured names.
Deploy an Environment
To create an Environment for a pull request, add the lifecycle-deploy! label.
Tear down an Environment
To delete an active Environment, use one of these actions:
- Remove
lifecycle-deploy! - Add
lifecycle-disabled!
Prevent TTL cleanup
Add lifecycle-keep!. This label prevents inactivity-based TTL cleanup. It does
not prevent manual teardown. When the pull request closes, the label does not
prevent cleanup. See
Environment TTL.
Clean up a closed pull request
When a pull request closes, Lifecycle:
- Tears down the active Environment.
- Removes the configured deploy label from the pull request.
These actions remove Environments that are not necessary after the pull request closes.
See Configurable labels for label effects and customized names.