From 4f1c052d288412aadda98270420cdcfb76cf3b73 Mon Sep 17 00:00:00 2001 From: sanbuphy Date: Mon, 12 Jan 2026 13:07:50 +0800 Subject: [PATCH] ci(deploy): dynamically set base path for vite build Use repository name from GitHub context instead of hardcoding it to make the workflow more flexible and reusable across different repositories --- .github/workflows/deploy.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7afd988..ddc0f7f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,8 +40,10 @@ jobs: - name: Install dependencies run: npm ci - name: Build with VitePress - # 假设仓库名为 easy-vibe,如果是其他名称,请修改 /easy-vibe/ 为 /仓库名/ - run: npm run build -- --base /easy-vibe/ + run: | + REPO_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}') + echo "Building for repository: $REPO_NAME" + npm run build -- --base /$REPO_NAME/ - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: