GFramework/.github/workflows/publish-docs.yml
GeWuYou 62fbfd41e1 chore(workflow): 添加手动触发文档发布工作流功能
- 在 GitHub Actions 工作流配置中添加 workflow_dispatch 触发器
- 允许通过 GitHub 界面手动运行文档发布流程
- 保留原有的 push 和 tags 触发规则
- 维持现有的权限设置不变
2026-02-11 13:45:51 +08:00

60 lines
1.3 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:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-and-deploy:
if: |
(startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-'))
|| contains(github.event.head_commit.message, '[release doc]'))
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# 1⃣ 拉取仓库代码
- name: Checkout
uses: actions/checkout@v4
# 2⃣ 安装 Bun.js
- uses: oven-sh/setup-bun@v2
with:
bun-version: 2.1.x
# 3⃣ 安装依赖
- name: Install Dependencies
run: |
cd docs
bun install
# 4⃣ 构建 VitePress
- name: Build VitePress
run: |
cd docs
bun 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