Skip to content

Merge pull request #60 from tremho/battery-tests #4

Merge pull request #60 from tremho/battery-tests

Merge pull request #60 from tremho/battery-tests #4

# @file publish-mdbook.yml
#
# A Github workflow that compiles an mdbook located at guide_book/* and publishes it
# to the repository's github page.
#
name: Build and Publish Guide Book
on:
# Trigger this workflow manually if necessary
workflow_dispatch:
# Triggers this workflow if a commit is pushed to main in which a file in
# bookshelf/** has been updated
push:
branches:
- main
paths:
- guide_book/**
jobs:
build:
name: Build Guide Book
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install MdBook
run: cargo install mdbook
- name: Install Mermaid
run: cargo install mdbook-mermaid
- name: Build the Guide Book
run: |
cd guide_book
mdbook build
- name: Upload Github Pages Site Artifact
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: guide_book/book/
publish:
name: Publish Guide Book
needs: [build]
runs-on: ubuntu-latest
environment:
name: github-pages # 👈 Required for GitHub Pages deployment
permissions:
id-token: write
contents: read
pages: write
steps:
- name: Deploy Github Page
uses: actions/deploy-pages@v4
with:
token: ${{ github.token }}
artifact_name: github-pages