Skip to content

Commit

Permalink
ci: new workflow to update setup-texlive cache (#15)
Browse files Browse the repository at this point in the history
* ci: new workflow to update setup-texlive cache

* drop the "List new cache" step

setup-texlive-action creates cache in the `runs.post` action.

* cleanup

* add gh doc links [ci skip]
  • Loading branch information
muzimuzhi authored Dec 27, 2024
1 parent 6cef39c commit 77054a1
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/update-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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: |
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@v3
with:
package-file: .github/tl_packages
update-all-packages: true

0 comments on commit 77054a1

Please sign in to comment.