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
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
name: Build mdbook
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with:
persist-credentials: false
- name: Install mdbook
uses: peaceiris/actions-mdbook@ee69d230fe19748b7abf22df32acaa93833fad08 with:
mdbook-version: "0.5.3"
- name: Build documentation
run: mdbook build mdbook
- name: Upload artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 with:
path: mdbook/book
include-hidden-files: true
deploy:
name: Deploy to GitHub Pages
needs: build
permissions:
contents: read
pages: write
id-token: write
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@368f82528645a54fb793d4d04e342629a3f51346