> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## Clean up GitHub Actions preview deployments on merge

developer-tools

The [GitHub Actions preview workflow](/learn/docs/preview-publish/preview-changes#automate-with-github-actions) now has an optional companion `cleanup-preview.yml` workflow that deletes a pull request's preview deployment once the PR merges, so stale previews don't linger.

To adopt this workflow, add `.github/workflows/cleanup-preview.yml` alongside your existing preview workflow.

Read the docs