Strategy for cleaning up Vercel deployments #1659
-
SummaryBackground / contextI'm using a custom github workflow file with the vercel CLI instead of the github autodeploy integeration feature (since I need more control regarding the order of deployment). I have one temporary database deployed for every pull request branch (which is torn down when the PR is closed). A new vercel deployment is created on every push to the pull request branch. In fact this is a bit unnecessary since I really only need one active deployment for every PR at any given time (namely, the latest commit on that branch). Everything works fine, but the result is that I'm creating a pile of vercel deployments which are never removed and will continue to grow until their mass makes them implode into a black hole. This feels wasteful, and I just don't like the idea of a bunch of URLs hanging around out there with no purpose. QuestionHow can I systematically clean up after myself? I would ideally like to find out
I'm aware that when running I expected it to be possible to "delete all deployments for a given branch", or running Thank you for any assistance, and please feel free to ask further questions if something is not clear. Additional informationParts of my workflow file
EDITNote: I found a specification for the git metadata here but when I query the Vercel API I only get either I also tried setting a metadata key on deploy (which worked!) I am lost. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi, do we have any updates on this one? I am also having the same issue |
Beta Was this translation helpful? Give feedback.
-
You can now configure the retention period for deployments through the dashboard and CLI. For example, canceled and errored deployments might be set to 30 days retention, while production deployments might be set to 1 year. Recently deleted deployments are shown in your project settings and can be instantly restored within 30 days of deletion. Learn more in our documentation. |
Beta Was this translation helpful? Give feedback.
You can now configure the retention period for deployments through the dashboard and CLI.
For example, canceled and errored deployments might be set to 30 days retention, while production deployments might be set to 1 year. Recently deleted deployments are shown in your project settings and can be instantly restored within 30 days of deletion.
Learn more in our documentation.