Skip to content

Commit 07ccff9

Browse files
committed
correct deletion code
Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
1 parent 05061f9 commit 07ccff9

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/keep-build-cache-small.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88

99
env:
1010
CACHE_THRESHOLD_GB: 6.5
11-
BUILD_CACHE_IMAGE: ghcr.io/autowarefoundation/autoware-buildcache:amd64-main
11+
IMAGE_NAME: autoware-buildcache
12+
IMAGE_TAG: amd64-main
1213

1314
jobs:
1415
keep-build-cache-small:
@@ -19,6 +20,10 @@ jobs:
1920
sudo apt-get update
2021
sudo apt-get install -y skopeo jq bc
2122
23+
- name: Set up BUILD_CACHE_IMAGE environment variable
24+
run: |
25+
echo "BUILD_CACHE_IMAGE=ghcr.io/autowarefoundation/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}" >> "$GITHUB_ENV"
26+
2227
- name: Login to GitHub Container Registry
2328
uses: docker/login-action@v3
2429
with:
@@ -65,10 +70,13 @@ jobs:
6570
fi
6671
6772
- name: Delete build cache if exceeded
73+
uses: bots-house/ghcr-delete-image-action@v1.1.0
6874
if: steps.check_threshold.outputs.status == 'exceeded'
69-
run: |
70-
echo "🗑️ Deleting build cache image: ${{ env.BUILD_CACHE_IMAGE }}..."
71-
skopeo delete docker://${{ env.BUILD_CACHE_IMAGE }}
75+
with:
76+
name: ${{ env.IMAGE_NAME }}
77+
tag: ${{ env.IMAGE_TAG }}
78+
owner: ${{ github.repository_owner }}
79+
token: ${{ secrets.GITHUB_TOKEN }}
7280

7381
- name: Verify cache deletion
7482
if: steps.check_threshold.outputs.status == 'exceeded'

0 commit comments

Comments
 (0)