Skip to content

Commit

Permalink
Remove trailing nosense
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyanesh Mishra authored and Gyanesh Mishra committed Dec 7, 2023
1 parent 085ca21 commit 9d4f6b7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build-soci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
id: vars
run: |
tag_hash=$(echo -n "tags" | md5sum)
tag_hash=$(echo -n "$tags" | md5sum | awk '{print $1}')
echo "tag_hash=$tag_hash" >> $GITHUB_OUTPUT
echo "image_path=/var/lib/kubelet/lorax" >> $GITHUB_OUTPUT
- name: Build Docker Image Cache
uses: docker/build-push-action@v2
Expand All @@ -89,14 +90,15 @@ jobs:
file: ./Dockerfile # Path to your Dockerfile
push: false
tags: ${{ steps.meta.outputs.tags }}
outputs: type=oci,oci-mediatypes=true,dest=/tmp/lorax-${{ steps.vars.outputs.tag_hash }}.tar
outputs: type=oci,oci-mediatypes=true,dest=${{ steps.vars.outputs.image_path }}-${{ steps.vars.outputs.tag_hash }}.tar

- name: Import image in containerd
env:
tag_hash: ${{ steps.vars.outputs.tag_hash }}
image_path: ${{ steps.vars.outputs.image_path }}
run: |
echo "Importing $tag_hash to Containerd"
sudo ctr i import --digests /tmp/lorax-$tag_hash.tar
echo "Importing $image_path-$tag_hash to Containerd"
sudo ctr i import --digests $image_path-$tag_hash.tar
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
Expand Down Expand Up @@ -131,12 +133,13 @@ jobs:
- name: Prune older images
env:
tag_hash: ${{ steps.vars.outputs.tag_hash }}
image_path: ${{ steps.vars.outputs.image_path }}
run: |
# Delete images older than a day from docker store
docker image prune -a -f --filter "until=24h"
# Delete the on disk copy
rm -rf "/tmp/lorax-$tag_hash.tar"
rm -rf "$image_path-$tag_hash.tar"
# Delete the SHA image(s) from containerd store
sudo ctr i rm $(sudo ctr i ls -q)
Expand Down

0 comments on commit 9d4f6b7

Please sign in to comment.