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
This commit is contained in:
sanbuphy
2026-01-12 13:07:50 +08:00
parent 0d2f3c5c10
commit 4f1c052d28
+4 -2
View File
@@ -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: