mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 将 Node.js 设置替换为 Bun.js 安装 - 更新依赖安装命令从 npm 到 bun - 更新构建命令从 npm run build 到 bun run build - 移除缓存配置选项
59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
# 工作流名称:Publish Docs (VitePress)
|
||
|
||
name: Publish Docs
|
||
|
||
on:
|
||
push:
|
||
tags:
|
||
- 'v*'
|
||
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, '-'))
|
||
|| (github.ref == 'refs/heads/main' && 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: latest
|
||
# 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
|