-
Notifications
You must be signed in to change notification settings - Fork 11
50 lines (45 loc) · 1.42 KB
/
clear-cache.yaml
File metadata and controls
50 lines (45 loc) · 1.42 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Clear Runner Cache
on:
workflow_dispatch:
inputs:
cache:
description: "Which cache to clear"
required: true
type: choice
options:
- software
- datasets
- all
permissions:
contents: read
jobs:
clear-cache:
if: github.repository == 'Climate-REF/climate-ref'
runs-on: "arc-climate-ref"
defaults:
run:
shell: bash
steps:
- name: Clear software cache
if: inputs.cache == 'software' || inputs.cache == 'all'
run: |
echo "Clearing software cache at /data/cache/software"
ls -la /data/cache/software/ || true
rm -rf /data/cache/software/*
echo "Software cache cleared"
- name: Clear dataset cache
if: inputs.cache == 'datasets' || inputs.cache == 'all'
run: |
echo "Clearing dataset cache at /data/cache/datasets"
ls -la /data/cache/datasets/ || true
rm -rf /data/cache/datasets/*
echo "Dataset cache cleared"
- name: Verify
run: |
echo "=== Software cache ==="
du -sh /data/cache/software/ 2>/dev/null || echo "Empty or does not exist"
ls /data/cache/software/ 2>/dev/null || true
echo ""
echo "=== Dataset cache ==="
du -sh /data/cache/datasets/ 2>/dev/null || echo "Empty or does not exist"
ls /data/cache/datasets/ 2>/dev/null || true