garrison 0.9.0

Garrison - 面向 Rust 生态的一站式身份认证鉴权框架
Documentation
# Copyright (c) 2026 Kirky.X🌠
# SPDX-License-Identifier: Apache-2.0

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 # v7.0.1
        with:
          persist-credentials: false

      - name: Install mdbook
        uses: peaceiris/actions-mdbook@ee69d230fe19748b7abf22df32acaa93833fad08 # v2.0.0
        with:
          mdbook-version: "0.5.3"

      - name: Build documentation
        run: mdbook build mdbook

      - name: Upload artifact
        # v5.0.0: 默认排除 dotfiles;显式启用 include-hidden-files 保留 .nojekyll
        # .nojekyll 是 GitHub Pages 必需文件,禁用 Jekyll 处理避免破坏静态资源
        uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
        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 # v5.0.1