Skip to content

Commit

Permalink
ci(docs): add cache for mdbook packages
Browse files Browse the repository at this point in the history
  • Loading branch information
AtomicFS committed Feb 15, 2024
1 parent 086c6fe commit 627959c
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/documentation-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,35 @@ concurrency:
group: 'pages'
cancel-in-progress: false

env:
CARGO_TARGET_DIR: mdbook-bin

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Restore cached mdbook
uses: actions/cache/restore@v4
with:
path: ${{ env.CARGO_TARGET_DIR }}
restore-keys: |
mdbook-${{ hashFiles('**/Cargo.lock') }}
mdbook-
mdbook
- name: Install mdBook
run: |
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
rustup update
# Cleanup cache
cargo install cargo-cache
cargo cache --autoclean
# Install mdbook with plugins
cargo install \
mdbook \
mdbook-admonish \
Expand All @@ -46,6 +65,12 @@ jobs:
mdbook-pagetoc \
mdbook-template \
mdbook-toc
- name: Store cached mdbook
uses: actions/cache/save@v4
with:
path: ${{ env.CARGO_TARGET_DIR }}
key: mdbook-${{ hashFiles('**/Cargo.lock') }}

- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
Expand Down

0 comments on commit 627959c

Please sign in to comment.