Skip to content

typeofchat/do-container-registry-housekeeping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

DigitalOcean Container Registry Housekeeping

A GitHub Action that automatically cleans up old container image manifests from your DigitalOcean Container Registry to prevent unexpected storage billing.

Overview

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.

Usage

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

Inputs

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.

Dependencies

  • A DigitalOcean API access token with read/write access to your container registry.
  • jq (pre-installed on GitHub Actions runners).

License

Licensed under MIT License, see LICENSE for details.

Copyright (c) 2026 typeof.chat

About

GitHub Action to clean up old container image manifests from DigitalOcean Container Registry to prevent storage billing overages. 🧹

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors