Skip to content

Commit ff84aa0

Browse files
committed
👷 repopulate cache
1 parent 8301859 commit ff84aa0

2 files changed

Lines changed: 23 additions & 6 deletions

File tree

.github/actions/data-cache/action.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,14 @@ runs:
7070
popd
7171
7272
mkdir -p sources/5etools-img
73-
gh release download ${LATEST_5E_VERSION} -D sources/5etools-img -R 5etools-mirror-3/5etools-img
73+
git clone -b ${LATEST_5E_VERSION} \
74+
--single-branch --depth=1 \
75+
-c advice.detachedHead=false \
76+
https://github.com/5etools-mirror-3/5etools-img.git sources/5etools-img
7477
pushd sources/5etools-img
75-
zip -FF img-${LATEST_5E_VERSION}.zip --out fixed.zip
76-
unzip -q fixed.zip
77-
rm *.z*
7878
du -sh .
7979
# replace all images w/ empty files. We don't care about image content for test purposes
80-
find img -type f | while read FILE; do echo > "$FILE"; done
81-
mv img/* .
80+
find . -type f -not -path '*/.git*' | while read FILE; do echo > "$FILE"; done
8281
du -sh .
8382
popd
8483

.github/workflows/cache.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Refresh cache
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
cache:
7+
runs-on: ubuntu-latest
8+
outputs:
9+
cache_key: ${{ steps.data_cache.outputs.cache_key }}
10+
steps:
11+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
12+
13+
- id: data_cache
14+
uses: ./.github/actions/data-cache
15+
16+
- uses: ./.github/actions/native-data-cache
17+
with:
18+
cache_key: ${{ steps.data_cache.outputs.cache_key }}

0 commit comments

Comments
 (0)