GFramework/.github/workflows/publish-docs.yml
GeWuYou 8f30361972 refactor(docs): 将文档构建工具从 DocFX 迁移到 VitePress
- 移除 .NET SDK 相关配置,改为使用 Node.js 环境
- 更新依赖安装方式,使用 npm 替代 dotnet restore
- 修改构建命令为 npm run build,替换原有的 DocFX 构建流程
- 调整输出路径配置,从 docfx/_site 改为 docs/.vitepress/dist
- 更新工作流触发条件,启用 push 触发器替代手动触发
- 重命名作业名称为 build-and-deploy,简化部署流程
- 更新 Action 版本号,统一使用较新的版本
- [release ci]
2026-02-11 12:52:14 +08:00

62 lines
1.2 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

# 工作流名称Publish Docs (VitePress)
name: Publish Docs
on:
push:
branches:
- '**'
tags:
- '*'
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# 1⃣ 拉取仓库代码
- name: Checkout
uses: actions/checkout@v4
# 2⃣ 安装 Node.js
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
# 3⃣ 安装依赖
- name: Install Dependencies
run: |
cd docs
npm install
# 4⃣ 构建 VitePress
- name: Build VitePress
run: |
cd docs
npm run build
# 5⃣ 上传构建产物
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
# 6⃣ 部署到 GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4