59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
name: Documentation
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "docs/**"
|
|
- ".github/workflows/docs.yml"
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "docs/**"
|
|
- ".github/workflows/docs.yml"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Markdown manual
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- name: Configure GitHub Pages
|
|
uses: actions/configure-pages@v5
|
|
|
|
- name: Install mdBook
|
|
run: cargo install mdbook --version 0.5.3 --locked
|
|
|
|
- name: Build the site
|
|
run: mdbook build docs
|
|
|
|
- name: Upload Pages artifact
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
uses: actions/upload-pages-artifact@v4
|
|
with:
|
|
path: target/docs
|
|
|
|
deploy:
|
|
name: Deploy documentation
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
needs: build
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|