-
Notifications
You must be signed in to change notification settings - Fork 9
36 lines (30 loc) · 1.26 KB
/
lifecycle-policy.yml
File metadata and controls
36 lines (30 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# https://github.com/marketplace/actions/delete-package-versions
# Ignore SemVer tags (proper releases)
# Keep 7 sha tagged images (ordred by publish datetime)
name: Container Lifecycle Policy
on:
schedule:
- cron: '30 9 * * *'
permissions:
contents: read
env:
IMAGE_NAME: appwrite/base
REGISTRY: docker.io
jobs:
prune_sha_tagged_images:
runs-on: ubuntu-24.04
steps:
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# TODO pull all the images in the registry before running this. Be sure we have a backup
# # https://github.com/marketplace/actions/delete-package-versions#delete-oldest-x-number-of-versions-while-ignoring-particular-package-versions
# # Ignore SemVer tagged images https://ihateregex.io/expr/semver/
# - uses: actions/delete-package-versions@v5
# with:
# ignore-versions: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
# min-versions-to-keep: 7
# package-name: 'base'
# package-type: 'container'