-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.03 KB
/
update-cache.yml
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
name: Update cache
on:
schedule:
# at 11:31 UTC (19:31 CST/UTC +8) on every Friday
# https://crontab.guru/#31_11_*_*_5
- cron: "31 11 * * 5"
workflow_dispatch:
jobs:
update-cache:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: actions/checkout@v4
# https://cli.github.com/manual/gh_cache_list
# https://cli.github.com/manual/gh_cache_delete
- name: Delete setup-texlive-action caches
run: |
set -x
cache_keys=$(\
gh cache list --key setup-texlive --json key --jq '.[].key')
if [[ $(wc -l <<< "$cache_keys") -gt 1 ]]; then
echo "Multiple setup-texlive-action caches found"
for key in $cache_keys; do
echo "$key"
done
exit 1
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create new cache
uses: teatimeguest/setup-texlive-action@v3
if: false
with:
package-file: .github/tl_packages
update-all-packages: true