-
Notifications
You must be signed in to change notification settings - Fork 1
30 lines (28 loc) · 1.17 KB
/
Copy pathclear_cache.yml
File metadata and controls
30 lines (28 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Clear kernel cache
on:
workflow_dispatch:
jobs:
clear-cache:
runs-on: rehosting-arc
steps:
- name: Trust Harbor's self-signed certificate
run: |
echo "Fetching certificate from ${{ secrets.REHOSTING_ARC_REGISTRY }}"
openssl s_client -showcerts -connect ${{ secrets.REHOSTING_ARC_REGISTRY }}:443 < /dev/null 2>/dev/null | openssl x509 -outform PEM | sudo tee /usr/local/share/ca-certificates/harbor.crt > /dev/null
sudo update-ca-certificates
- uses: oras-project/setup-oras@v1.2.3
- name: Log in to Rehosting Arc Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REHOSTING_ARC_REGISTRY }}
username: ${{ secrets.REHOSTING_ARC_REGISTRY_USER }}
password: ${{ secrets.REHOSTING_ARC_REGISTRY_PASSWORD }}
- name: Delete all kernel cache images
run: |
set -e
repo="${{ secrets.REHOSTING_ARC_REGISTRY }}/rehosting/linux_builder_cache"
tags=$(oras repo tags $repo)
for tag in $tags; do
echo "Deleting $repo:$tag"
oras repo rm $repo:$tag || echo "Failed to delete $repo:$tag"
done