A GitHub Action that automatically cleans up old container image manifests from your DigitalOcean Container Registry to prevent unexpected storage billing.
DigitalOcean's Container Registry (DOCR) does not enforce storage limits.
Instead, when the storage limit included in a plan is exceeded, DigitalOcean silently allows for billable overage. Every CI/CD push creates a new image manifest, and without proactive housekeeping, these accumulate indefinitely driving up storage usage and cost.
This action solves that by deleting old image versions after each push, keeping only the N most recent tagged versions. It can also optionally trigger garbage collection to reclaim the underlying blob storage.
Add this step to your workflow after you push your image:
- name: DigitalOcean Container Registry Housekeeping
uses: typeofchat/do-container-registry-housekeeping@v1
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
repository: my-app
garbage_collect: true| Input | Required | Default | Description |
|---|---|---|---|
token |
Yes | — | DigitalOcean API token with registry read/write access. |
repository |
Yes | — | Repository name within your registry (e.g. my-app). |
keep |
No | 3 |
Number of most recent tagged versions to keep. The latest tag is always preserved. |
garbage_collect |
No | false |
Run garbage collection after housekeeping to reclaim blob storage. |
- A DigitalOcean API access token with read/write access to your container registry.
jq(pre-installed on GitHub Actions runners).
Licensed under MIT License, see LICENSE for details.
Copyright (c) 2026 typeof.chat