Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
name: gh-pages-mdbook
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
paths:
|
|
- 'docs/mdbook/**'
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'docs/mdbook/**'
|
|
|
|
jobs:
|
|
gh-pages-mdbook-build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v4
|
|
- uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3.0.0
|
|
- name: Setup mdBook
|
|
uses: peaceiris/actions-mdbook@ee69d230fe19748b7abf22df32acaa93833fad08 # v2.0.0
|
|
- name: Install Dependencies
|
|
shell: bash
|
|
run: sudo apt-get install -y libwayland-dev libxkbcommon-dev # Required for winit
|
|
- name: Install mdbook-alerts, mdbook-mermaid
|
|
run: cargo install mdbook-alerts mdbook-mermaid
|
|
- name: Build
|
|
working-directory: docs/mdbook
|
|
shell: bash
|
|
run: mdbook build
|
|
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
with:
|
|
name: book
|
|
path: docs/mdbook/book/
|
|
|
|
gh-pages-mdbook-deploy:
|
|
needs: gh-pages-mdbook-build
|
|
if: github.event_name != 'pull_request'
|
|
name: Deploy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v4
|
|
- name: Download book
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v4
|
|
with:
|
|
name: book
|
|
path: artifacts/book
|
|
|
|
- name: Deploy
|
|
uses: JamesIves/github-pages-deploy-action@4a3abc783e1a24aeb44c16e869ad83caf6b4cc23 # v4.7.4
|
|
with:
|
|
branch: gh-pages
|
|
folder: artifacts/book
|
|
target-folder: docs/book
|