Skip to content

Commit

Permalink
[PIMINT-171] Improve cleanup
Browse files Browse the repository at this point in the history
Also remove tagged images older than 2 hours to cleanup
signatures.
  • Loading branch information
astehlik committed Jul 16, 2024
1 parent e39ed66 commit 7f03a37
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/docker-registry-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,21 @@ jobs:
id: multi-arch-digests
working-directory: /tmp/build-metadata/image-tags
run: |
digests=""
imageNames=""
for identifier in *; do
imageNameAndTag="$(cat ${identifier})"
imageName=$(echo $imageNameAndTag | cut -d: -f1)
imageUrl="${{ inputs.image_registry }}/${{ github.repository_owner }}/${imageNameAndTag}"
imageDigests=$(docker manifest inspect ${imageUrl} | jq -r '.manifests[] | .digest' | paste -s -d ' ' -)
imageNames="$imageNames $imageName"
digests="$digests $imageDigests"
done
echo "multi-arch-digests=$digests" >> $GITHUB_OUTPUT
echo "image-names=$imageNames" >> $GITHUB_OUTPUT
unqiueImageNames=$(echo $imageNames | tr ' ' '\n' | sort -u | tr '\n' ' ')
echo "image-names=$unqiueImageNames" >> $GITHUB_OUTPUT
- uses: snok/[email protected]
with:
account: basecom
token: ${{ secrets.GITHUB_TOKEN }}
image-names: ${{ steps.multi-arch-digests.outputs.image-names }}
cut-off: 0s
tag-selection: untagged
cut-off: 2h
dry-run: false
skip-shas: ${{ steps.multi-arch-digests.outputs.multi-arch-digests }}

0 comments on commit 7f03a37

Please sign in to comment.