Files
freeCodeCamp/.github/workflows/docker-docr-cleanup.yml
2026-05-13 13:21:49 +05:30

36 lines
988 B
YAML

name: CD - Docker - DOCR Cleanup Container Images
on:
workflow_dispatch:
schedule:
- cron: '5 0 * * 3,6' # 12:05 UTC on Wednesdays and Saturdays (6 hour maintenance window)
jobs:
remove:
name: Delete Old Images
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
repos:
- learn-api
variants:
- dev
- org
steps:
- name: Install doctl
uses: digitalocean/action-doctl@3cb3953159719656269e044e0e24ca16dd2a690f # v2.5.2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log in to DigitalOcean Container Registry with short-lived credentials
run: doctl registry login --expiry-seconds 1200
- name: Delete Images
uses: raisedadead/action-docr-cleanup@1c7d87369bccfdf5da03a9ae3b00eacc3f2a9b51 # v1
with:
repository_name: '${{ matrix.variants }}/${{ matrix.repos }}'
days: '7'
keep_last: '3'