@timeraa/do-registry-cleanup

1.0.1 • Public • Published

DigitalOcean Registry Cleanup

npm version License GitHub Workflow Status

[!IMPORTANT] Every tag deletion is a separate API call to DigitalOcean. This can hit your DigitalOcean account rate limit really fast if you have a lot of tags.

This GitHub Action and CLI tool helps you clean up old Docker tags from your DigitalOcean container registry. It allows you to keep a specified number of recent versions, unique semver versions, and tags within a certain retention period.

Features

  • Delete old Docker tags from DigitalOcean container registry
  • Keep a specified number of recent versions
  • Keep a specified number of unique semver versions
  • Retain tags within a specified number of days
  • Include or exclude repositories using glob patterns
  • Perform a dry run without actually deleting tags
  • Concurrent processing of repositories and tags for improved performance

Usage

GitHub Action

To use this action in your workflow, add the following step:

- name: Setup DigitalOcean CLI
  uses: digitalocean/action-doctl@v2
  with:
    token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: DigitalOcean Registry Cleanup
  uses: timeraa/do-registry-cleanup@v1
  with:
    # Required
    registry-name: ${{ secrets.DIGITALOCEAN_REGISTRY_NAME }}
    # Optional
    keep-versions: 3
    keep-semver: 2
    retention-days: 30
    dry-run: true
    include-repos: 'repo1, repo2'
    exclude-repos: 'repo3, repo4'
    repo-concurrency: 3
    tag-concurrency: 3

CLI

Use the cli using the following command:

npx @timeraa/do-registry-cleanup -h

Package Sidebar

Install

npm i @timeraa/do-registry-cleanup

Weekly Downloads

19

Version

1.0.1

License

MIT

Unpacked Size

536 kB

Total Files

6

Last publish

Collaborators

  • timeraa