ci(docs): add github pages deploy workflow and set base path
2 个文件变更
+55
-0
13172193298@163.com
| •.github/workflows/deploy.yml | +54 -0 |
| •docs/.vitepress/config.ts | +1 -0 |
变更内容
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 0000000..bf8924e
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -0,0 +1,54 @@
+name: Deploy VitePress to GitHub Pages
+
+on:
+ push:
+ branches: [main, master, dev/v1.84]
+ workflow_dispatch:
+
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+concurrency:
+ group: pages
+ cancel-in-progress: false
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: docs
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: npm
+ cache-dependency-path: docs/package-lock.json
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Build
+ run: npm run build
+
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v3
+ with:
+ path: docs/.vitepress/dist
+
+ deploy:
+ needs: build
+ runs-on: ubuntu-latest
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v4
diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts
index 24fc62e..ec75c44 100644
--- a/docs/.vitepress/config.ts
+++ b/docs/.vitepress/config.ts
@@ -4,6 +4,7 @@ export default defineConfig({
title: 'MNBT 文档',
description: '梦奈宝塔主机系统 — 虚拟主机分销、Docker 容器托管、插件与主题生态',
lang: 'zh-CN',
+ base: '/MNBT/',
themeConfig: {
logo: '/logo.png',