Skip to content

Commit ea1254f

Browse files
committed
Put checkout before cache restore, since checkout was wiping out cache
1 parent 4edbc2b commit ea1254f

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

.github/workflows/latex-pages.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,26 @@ jobs:
1818
build:
1919
runs-on: ubuntu-latest
2020
steps:
21+
- name: Checkout repo
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
2125
- name: Restore PDF cache
2226
uses: actions/cache@v4
2327
with:
2428
path: build-pdf
2529
key: pdf-cache-v5
2630
restore-keys: |
2731
pdf-cache-v5
28-
- name: Checkout repo
29-
uses: actions/checkout@v4
32+
- name: Debug cache contents
33+
run: |
34+
echo "After cache restore:"
35+
ls -la build-pdf || true
36+
- name: Cache TeX Live
37+
uses: actions/cache@v4
3038
with:
31-
fetch-depth: 0
39+
path: /opt/texlive
40+
key: texlive-2024-v1
3241
- name: Get changed LaTeX files
3342
id: latex-files
3443
run: |
@@ -44,10 +53,27 @@ jobs:
4453
PLURAL_S=''
4554
fi
4655
echo "PLURAL_S=$PLURAL_S" >> $GITHUB_ENV
47-
- name: Install TeX Live
56+
- name: Install TeX Live (if needed)
4857
run: |
49-
sudo apt-get update
50-
sudo apt-get install -y texlive-full
58+
if [ ! -d /opt/texlive/2024 ]; then
59+
echo "Installing TeX Live 2024..."
60+
sudo mkdir -p /opt/texlive
61+
sudo chown -R $USER:$USER /opt/texlive
62+
63+
curl -L https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz | tar xz
64+
cd install-tl-*
65+
./install-tl --profile=/dev/stdin <<EOF
66+
selected_scheme scheme-full
67+
TEXDIR /opt/texlive/2024
68+
TEXMFCONFIG ~/.texlive2024/texmf-config
69+
TEXMFVAR ~/.texlive2024/texmf-var
70+
TEXMFHOME ~/texmf
71+
option_doc 0
72+
option_src 0
73+
EOF
74+
else
75+
echo "Using cached TeX Live"
76+
fi
5177
- name: Compile LaTeX
5278
run: |
5379
PDF_CACHE_DIR="$GITHUB_WORKSPACE/build-pdf"

0 commit comments

Comments
 (0)