# Sample workflow for building and deploying a mdBook site to GitHub Pages## To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html#name:Deploy mdBook site to Pageson:# Runs on pushes targeting the default branchpush:branches:["main"]# Allows you to run this workflow manually from the Actions tabworkflow_dispatch:# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pagespermissions:contents:readpages:writeid-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:falsejobs:# Build jobbuild:runs-on:ubuntu-latestenv:MDBOOK_VERSION:0.4.36steps:-uses:actions/checkout@v4-name:Install mdBookrun:|curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | shrustup updatecargo install --version ${MDBOOK_VERSION} mdbook-name:Setup Pagesid:pagesuses:actions/configure-pages@v4-name:Build with mdBookrun:mdbook build-name:Upload artifactuses:actions/upload-pages-artifact@v3with:path:./book# Deployment jobdeploy:environment:name:github-pagesurl:${{ steps.deployment.outputs.page_url }}runs-on:ubuntu-latestneeds:buildsteps:-name:Deploy to GitHub Pagesid:deploymentuses:actions/deploy-pages@v4
# Sample workflow for building and deploying a mdBook site to GitHub Pages## To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html#name:Deploy mdBook site to Pageson:push:branches:["main"]workflow_dispatch:permissions:contents:readpages:writeid-token:writeconcurrency:group:"pages"cancel-in-progress:falsejobs:build:runs-on:ubuntu-latestenv:MDBOOK_VERSION:0.4.36MDBOOK_ADMONISH_VERSION:"1.18.0"# Specify the version of mdbook-admonishsteps:-uses:actions/checkout@v4-name:Install Rust and mdBookrun:|curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | shrustup updatecargo install --version ${MDBOOK_VERSION} mdbook-name:Install mdbook-admonishrun:|cargo install mdbook-admonish --version ${MDBOOK_ADMONISH_VERSION}mdbook-admonish install ./ # This installs the required assets for admonish-name:Setup Pagesid:pagesuses:actions/configure-pages@v4-name:Build with mdBookrun:mdbook build-name:Upload artifactuses:actions/upload-pages-artifact@v3with:path:./bookdeploy:environment:name:github-pagesurl:${{ steps.deployment.outputs.page_url }}runs-on:ubuntu-latestneeds:buildsteps:-name:Deploy to GitHub Pagesid:deploymentuses:actions/deploy-pages@v4