From bf6b76237194b4be40f3330707102fbf23071105 Mon Sep 17 00:00:00 2001 From: yisier <1340976576@qq.com> Date: Mon, 8 Jun 2026 00:16:42 -0600 Subject: [PATCH] docs --- .github/workflows/docs.yml | 62 ++++++++++++++++++++++++++++++++++++++ docs/.vuepress/config.ts | 1 + 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..639e9ec --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,62 @@ +name: Deploy Docs to GitHub Pages + +on: + push: + branches: [master] + paths: + - 'docs/**' + - '.github/workflows/docs.yml' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +# 并发:同一时刻只允许一次部署,新的提交会取消上一个未完成的运行 +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # lastUpdated 需要完整 git 历史 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + cache-dependency-path: docs/package-lock.json + + - name: Install dependencies + working-directory: docs + run: npm install --legacy-peer-deps + + - name: Build VuePress site + working-directory: docs + run: npm run docs:build + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/.vuepress/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/.vuepress/config.ts b/docs/.vuepress/config.ts index b0b301d..c5b6035 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -31,6 +31,7 @@ const extendSidebar: SidebarConfig = [ ] export default defineUserConfig({ + base: '/nps/', bundler: viteBundler(), lang: 'zh-CN', title: 'NPS',