name: Docs
on:
push:
branches: [main]
paths:
- "mdbook/**"
- ".github/workflows/docs.yml"
pull_request:
branches: [main]
paths:
- "mdbook/**"
- ".github/workflows/docs.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
name: Build mdbook
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Install mdbook
uses: peaceiris/actions-mdbook@062dc9e3eab0bad35531417c6bb6c6a7a184764f with:
mdbook-version: "0.5.3"
- name: Build documentation
run: mdbook build mdbook
- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa with:
path: mdbook/book
deploy:
name: Deploy to GitHub Pages
needs: build
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e