Skip to content

Update CI

Update CI #18

Workflow file for this run

name: Deploy to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
check_examples:
runs-on: ubuntu-latest
env:
EXAMPLES_MANIFEST_PATH: ./examples/Cargo.toml
steps:
- uses: actions/checkout@v4
- name: Format
run: cargo fmt --manifest-path ${EXAMPLES_MANIFEST_PATH} -- --check
- name: Lint
run: cargo clippy --manifest-path ${EXAMPLES_MANIFEST_PATH} -- -D warnings
- name: Check
run: cargo check --manifest-path ${EXAMPLES_MANIFEST_PATH}
build_book:
needs: check_examples
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.43
steps:
- uses: actions/checkout@v4
- name: Install mdBook
run: cargo install --version ${MDBOOK_VERSION} mdbook
- name: Install D2
run: curl -fsSL https://d2lang.com/install.sh | sh -s --
- name: Install mdbook-d2
run: cargo install --git https://github.com/weipin/mdbook-d2.git --locked
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with mdBook
run: mdbook build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./book
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build_book
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4