Skip to content

Commit

Permalink
ci: add a workflow to update setup-texlive cache
Browse files Browse the repository at this point in the history
  • Loading branch information
muzimuzhi committed Dec 27, 2024
1 parent 6cef39c commit 1443a88
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/update-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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"
pull_request:
workflow_dispatch:

jobs:
update-cache:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: actions/checkout@v4

- name: Delete setup-texlive-action caches
run: |
cache_keys=$(\
gh cache list --key setup-texlive --json key --jq '.[].key')
for key in $cache_keys; do
echo "Deleting cache $key"
gh cache delete $key
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create new cache
uses: teatimeguest/setup-texlive-action
with:
package-file: .github/tl_packages
update-all-packages: true

- name: List new cache
run: |
GH_PAGER="" \
gh cache list --key setup-texlive --json id,key,ref,createdAt,lastAccessedAt
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1443a88

Please sign in to comment.