> 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 GitLab preview deployments on merge

developer-tools

The updated [GitLab CI/CD pipeline](/learn/docs/developer-tools/git-lab#add-the-cicd-pipeline) now includes a `cleanup_preview` stage that deletes a merge request's preview deployment once the MR merges into the default branch, so stale previews don't linger.

To adopt this workflow, replace your `.gitlab-ci.yml` file with the updated version.

Read the docs