Skip to content

Commit 4490055

Browse files
Improve cargo cache with static key and skip reinstall if exists
1 parent ecedbc9 commit 4490055

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/epub.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818

19-
- name: Cache cargo registry
19+
- name: Cache cargo
2020
uses: actions/cache@v4
2121
with:
2222
path: |
2323
~/.cargo/bin/
2424
~/.cargo/registry/index/
2525
~/.cargo/registry/cache/
2626
~/.cargo/git/db/
27-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
27+
key: ${{ runner.os }}-cargo-mdbook-pandoc-v1
2828
restore-keys: |
29-
${{ runner.os }}-cargo-
29+
${{ runner.os }}-cargo-mdbook-pandoc-
3030
3131
- name: Install mdbook
3232
uses: peaceiris/actions-mdbook@v2
@@ -49,7 +49,11 @@ jobs:
4949
5050
- name: Install mdbook-pandoc
5151
run: |
52-
cargo install mdbook-pandoc
52+
if ! command -v mdbook-pandoc &> /dev/null; then
53+
cargo install mdbook-pandoc
54+
else
55+
echo "mdbook-pandoc already installed"
56+
fi
5357
5458
- name: Build Book
5559
run: mdbook build

0 commit comments

Comments
 (0)