build: github workflow

This commit is contained in:
Burt 2024-12-06 15:04:26 +08:00
parent 7adec9e644
commit 140d80e17f
2 changed files with 12 additions and 8 deletions

View File

@ -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:

View File

@ -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",