Burt 1 год назад
Родитель
Сommit
140d80e17f
2 измененных файлов с 12 добавлено и 8 удалено
  1. 11 8
      .github/workflows/deploy-h5.yml
  2. 1 0
      .vscode/settings.json

+ 11 - 8
.github/workflows/deploy-h5.yml

@@ -1,10 +1,10 @@
-name: Deploy Pages
+name: Build and Deploy VitePress Site with Pnpm
 
 
 on:
 on:
-  # Runs on pushes targeting the default branch
   push:
   push:
-    branches: ['main']
-
+    branches:
+      - main # 你想要触发部署的分支名称
+  # 你可以根据需要添加其他触发条件
   # Allows you to run this workflow manually from the Actions tab
   # Allows you to run this workflow manually from the Actions tab
   workflow_dispatch:
   workflow_dispatch:
 
 
@@ -17,7 +17,8 @@ permissions:
 jobs:
 jobs:
   # Build job
   # Build job
   build:
   build:
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-latest # 运行环境
+
     steps:
     steps:
       # 设置服务器时区为东八区
       # 设置服务器时区为东八区
       - name: Set time zone
       - name: Set time zone
@@ -32,12 +33,14 @@ jobs:
           cache: 'pnpm'
           cache: 'pnpm'
       - name: Install dependencies
       - name: Install dependencies
         run: pnpm i --no-frozen-lockfile
         run: pnpm i --no-frozen-lockfile
-      - name: Build
-        run: pnpm build:h5
+
+      - name: Build VitePress site with Pnpm
+        run: pnpm run docs:build
+
       - name: Upload artifact
       - name: Upload artifact
         uses: actions/upload-pages-artifact@v3
         uses: actions/upload-pages-artifact@v3
         with:
         with:
-          path: ./dist/build/h5
+          path: ./docs/.vitepress/dist/
 
 
   # Deployment job
   # Deployment job
   deploy:
   deploy:

+ 1 - 0
.vscode/settings.json

@@ -46,6 +46,7 @@
     "tabbar",
     "tabbar",
     "unibest",
     "unibest",
     "uvui",
     "uvui",
+    "vitepress",
     "WechatMiniprogram"
     "WechatMiniprogram"
   ],
   ],
   "typescript.tsdk": "node_modules\\typescript\\lib",
   "typescript.tsdk": "node_modules\\typescript\\lib",