https://github.com/timeraa/do-registry-cleanup
Cleans up DigitalOcean Registry Repository tags based on creation / tag match
https://github.com/timeraa/do-registry-cleanup
Last synced: 11 months ago
JSON representation
Cleans up DigitalOcean Registry Repository tags based on creation / tag match
- Host: GitHub
- URL: https://github.com/timeraa/do-registry-cleanup
- Owner: Timeraa
- License: mit
- Created: 2024-03-15T08:26:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-01T16:44:54.000Z (over 1 year ago)
- Last Synced: 2024-12-01T17:37:44.854Z (over 1 year ago)
- Language: TypeScript
- Size: 470 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# DigitalOcean Registry Cleanup
[](https://www.npmjs.com/package/@timeraa/do-registry-cleanup)
[](https://github.com/timeraa/do-registry-cleanup/blob/main/LICENSE)
[](https://github.com/timeraa/do-registry-cleanup/actions/workflows/ci.yml)
> [!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:
```yaml
- 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:
```bash
npx @timeraa/do-registry-cleanup -h
```