Skip to content

Commit

Permalink
ci: cleanup cache after package is built or pushed
Browse files Browse the repository at this point in the history
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
  • Loading branch information
mudler committed Dec 6, 2021
1 parent d10bc62 commit 64c877e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash

sudo -E make PACKAGES="$1" build
sudo -E make PACKAGES="$1" build

docker images --filter="reference=$REPO_CACHE" --format='{{.Repository}}:{{.Tag}}' | xargs -r docker rmi --force
docker image prune --force
2 changes: 1 addition & 1 deletion .github/plugins/cleanup-images
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ exec 3>&1 1>>/tmp/cleanup-images.log 2>&1

event="$1"
payload="$2"
if [ "$event" == "package.post.build" ]; then
if [ "$event" == "image.post.push" ]; then
out=$(docker images --filter="reference=$REPO_CACHE" --format='{{.Repository}}:{{.Tag}}' | xargs -r docker rmi --force)
out1=$(docker image prune --force)
jq --arg key0 'state' \
Expand Down

0 comments on commit 64c877e

Please sign in to comment.