Skip to content

Commit

Permalink
Improve publish workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gohla committed Sep 20, 2023
1 parent 89a8d55 commit 76a499b
Showing 1 changed file with 31 additions and 22 deletions.
53 changes: 31 additions & 22 deletions .github/workflows/publish-tutorial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,14 @@ jobs:
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable
# Copy files for hashing in the next step, as `hashFiles` only works inside the workspace, not the home directory.
- id: copy-files-for-hashing
name: Copy files for hashing into workspace
run: |
cp ~/.cargo/.crates.toml .crates.toml.hash
cp ~/.cargo/.crates2.json .crates2.json.hash
# Caching for cargo binaries, mainly for speeding up `install-mdbook-processors`.
- id: cache-cargo-binaries
name: Cache Cargo binaries
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
key: ${{ runner.os }}-cargo-${{ hashFiles('.crates.toml.hash', '.crates2.json.hash') }}
restore-keys: ${{ runner.os }}-cargo-
# Caching for tutorial stepper application
- id: cache-stepper
name: Cache stepper
uses: actions/cache@v3
with:
path: tutorial/stepper/target
key: ${{ runner.os }}-stepper-${{ hashFiles('tutorial/stepper/Cargo.lock') }}
restore-keys: ${{ runner.os }}-stepper-
# Run stepper to verify that tutorial code works, and to generate diffs.
- id: run-stepper
name: Run stepper
Expand All @@ -60,11 +41,39 @@ jobs:
uses: taiki-e/install-action@v2
with:
tool: cargo-binstall
# Copy files for hashing in the next step, as `hashFiles` only works inside the workspace, not the home directory.
- id: copy-files-for-hashing
name: Copy files for hashing into workspace
run: |
cp ~/.cargo/.crates.toml .crates.toml.hash
cp ~/.cargo/.crates2.json .crates2.json.hash
# Caching for cargo binaries, mainly for speeding up `install-mdbook-processors`.
- id: cache-cargo-binaries
name: Cache Cargo binaries
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
key: ${{ runner.os }}-cargo-${{ hashFiles('.crates.toml.hash', '.crates2.json.hash') }}
restore-keys: ${{ runner.os }}-cargo-
- id: install-mdbook-preprocessors
name: Install mdBook preprocessors
run: cargo binstall --no-confirm --no-symlinks mdbook-admonish mdbook-external-links
- id: install-local-mdbook-preprocessors
name: Install local mdBook preprocessors
# Caching for tutorial mdbook-diff2html application
- id: cache-mdbook-diff2html
name: Cache mdbook-diff2html
uses: actions/cache@v3
with:
path: tutorial/mdbook-diff2html/target
key: ${{ runner.os }}-mdbook-diff2html-${{ hashFiles('tutorial/mdbook-diff2html/Cargo.lock') }}
restore-keys: ${{ runner.os }}-mdbook-diff2html-
- id: install-mdbook-diff2html-preprocessor
name: Install mdbook-diff2html preprocessors
run: cargo install --path tutorial/mdbook-diff2html
- id: build
name: Build tutorial mdBook
Expand Down

0 comments on commit 76a499b

Please sign in to comment.