-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup
mdbook
checks and GitHub pages (#19)
* feat(ci): test book code snippets * feat(ci): deploy design document to github pages * feat(ci): also run `mdbook build` in normal checks
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build and publish book | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
env: | ||
# This can be any valid Cargo version requirement, but should start with a caret `^` to opt-in to | ||
# SemVer-compatible changes. Please keep this in sync with `ci.yaml`. | ||
MDBOOK_VERSION: ^0.4.40 | ||
|
||
permissions: | ||
# Required to checkout repository. | ||
contents: read | ||
# Both are required to deploy to GitHub pages. | ||
pages: write | ||
id-token: write | ||
|
||
# Only allow one deployment to run at a time. | ||
concurrency: | ||
group: pages | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
name: Build and publish book | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Install mdbook | ||
run: cargo install mdbook --version ${{ env.MDBOOK_VERSION }} | ||
|
||
- name: Build book | ||
working-directory: design-book | ||
run: mdbook build | ||
|
||
- name: Upload pages artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: design-book/book | ||
|
||
- name: Deploy to GitHub pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters