Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add container cleanup cronjob #162

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/container-cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Container Registry Cleanup

on:
schedule:
- cron: "0 0 * * *" # every day at midnight
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
container-cleanup:
name: delete-images
runs-on: ubuntu-latest
strategy:
matrix:
image:
- "retina/charts/retina"
- "retina/kubectl-retina"
- "retina/retina-agent"
- "retina/retina-init"
- "retina/retina-operator"
steps:
# This is a fork of the official actions/delete-package-versions which adds GHCR image tag support
# https://github.com/actions/delete-package-versions/pull/104
- uses: port-of-rotterdam-dtis/delete-package-versions@bf25fb8df311fdcbeac67ba2e5153495d76415a8
rbtr marked this conversation as resolved.
Show resolved Hide resolved
with:
package-name: ${{ matrix.image }}
package-type: "container"
min-versions-to-keep: 0
ignore-versions: "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(\\.*)$"
ignore-versions-include-tags: true
6 changes: 2 additions & 4 deletions .github/workflows/release-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Release Retina Charts

on:
push:
branches: [main]
tags: ["v*"]

permissions:
Expand All @@ -25,15 +24,15 @@ jobs:

- uses: azure/[email protected]
id: install

- name: Install Cosign
uses: sigstore/[email protected]

- name: Log in to registry (Helm for pushing chart, Docker for signing and push signature)
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u $ --password-stdin
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Build, Push and Sign chart
id: build_chart
shell: bash
Expand All @@ -45,4 +44,3 @@ jobs:
helm push retina-$TAG.tgz oci://ghcr.io/${{ github.repository }}/charts >> helm_push_result.txt 2>&1
cat helm_push_result.txt
cosign sign --yes ghcr.io/${{ github.repository }}/charts/retina@$(tail -n 1 helm_push_result.txt | awk '{ print $2 }')

Loading