Files
OpenIsle/.github/workflows/deploy-docs.yml
2025-09-09 13:16:52 +08:00

57 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Deploy Documentation
on:
workflow_call:
inputs:
build-id:
required: false
type: string
workflow_dispatch:
permissions:
contents: write
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Log build
run: echo "Running documentation deployment from build ${{ inputs.build-id }}"
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Bun dependencies
run: bun install
working-directory: ./docs
- name: Generate API MDX
run: bun run generate
working-directory: ./docs
- name: Build documentation
# 确保这里最终执行的是 next build且 next.config 已 output: 'export'
run: bun run build
working-directory: ./docs
- name: Assert static output exists
run: |
test -f ./docs/out/index.html || (echo "❌ ./docs/out/index.html 不存在:请检查 next.config 的 output:'export' / basePath 配置" && exit 1)
echo "✅ Found ./docs/out/index.html"
find ./docs/out -maxdepth 2 -type f | head -n 30
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: ./docs/out
clean: true
cname: docs.open-isle.com