#Delete Preview Environments

1 messages · Page 1 of 1 (latest)

slate crown
#

How can I delete preview environments with a GitHub Actions Workflow?

fathom gustBOT
#

Hi @slate crown. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The knowledge sources don't provide specific instructions or a ready-made GitHub Actions workflow for deleting Convex preview deployments. However, based on what is documented, here's what you can use:

Deleting a Preview Deployment via the Management API

Convex exposes a Management API endpoint to delete a deployment:

POST /deployments/:deployment_name/delete

[delete deployment]

You could call this endpoint in a GitHub Actions workflow (e.g., on a pull_request closed event) using curl or similar tooling.

What the docs say about automatic cleanup

Preview deployments are automatically cleaned up:

  • 5 days after creation (or 14 days on the Professional plan), or
  • When a new preview deployment with the same name is created (i.e., pushing to the same branch replaces the old one).

They can also be manually deleted from the Convex dashboard. [preview deployments]

Limitation

The knowledge sources do not include a concrete example of a GitHub Actions workflow that calls the Management API to delete a preview deployment. For the exact API authentication details and request format needed to build such a workflow, I'd recommend checking the full Convex Management API docs or asking in the Convex Discord community.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: