Skip to content

Commit

Permalink
docker: Cleanup old images
Browse files Browse the repository at this point in the history
Will remove untagged images (old versions) older than 1 week, and tagged images  (branches and pull requests) older than 1 month, excluding the 'main', 'production', and 'graphql' branches.
  • Loading branch information
Kurocon authored May 7, 2024
1 parent b9fe136 commit b4681d6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,25 @@ jobs:
- name: Run Amelie tests
run: |
docker run --rm --entrypoint "/amelie/scripts/run_tests.sh" ghcr.io/inter-actief/amelie@${{ steps.push.outputs.digest }}
- name: Cleanup untagged images older than 1 week
uses: snok/container-retention-policy@v2
with:
image-names: ${{ env.IMAGE_NAME }}
cut-off: 1 week ago UTC
account-type: personal
token: ${{ secrets.GITHUB_TOKEN }}
token-type: github-token
untagged-only: true
dry-run: true

- name: Cleanup tagged images (except main, production and graphql) older than 1 month
uses: snok/container-retention-policy@v2
with:
image-names: ${{ env.IMAGE_NAME }}
cut-off: 1 month ago UTC
account-type: personal
token: ${{ secrets.GITHUB_TOKEN }}
token-type: github-token
skip-tags: main, production, graphql
dry-run: true

0 comments on commit b4681d6

Please sign in to comment.