41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
name: "Build: Cleanup Residue"
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
on:
|
|
workflow_call:
|
|
workflow_dispatch:
|
|
workflow_run:
|
|
workflows: ["Build Swarm Loadbalancer"]
|
|
types:
|
|
- completed
|
|
|
|
jobs:
|
|
cleanup-delete-candidate-image:
|
|
name: Delete candidate image
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: docker login ghcr.io -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: vlaurin/action-ghcr-prune@v0.6.0
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
organization: ${{ github.repository_owner }}
|
|
container: bouncer
|
|
dry-run: false
|
|
prune-tags-regexp: ^build-${{ github.sha }}$
|
|
cleanup-untagged-images:
|
|
name: Delete untagged images
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: docker login ghcr.io -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: vlaurin/action-ghcr-prune@v0.6.0
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
organization: ${{ github.repository_owner }}
|
|
container: bouncer
|
|
dry-run: false
|
|
keep-younger-than: 7 # days
|
|
keep-last: 2
|
|
prune-untagged: true
|