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:
@@ -40,8 +40,10 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Build with VitePress
|
- name: Build with VitePress
|
||||||
# 假设仓库名为 easy-vibe,如果是其他名称,请修改 /easy-vibe/ 为 /仓库名/
|
run: |
|
||||||
run: npm run build -- --base /easy-vibe/
|
REPO_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
|
||||||
|
echo "Building for repository: $REPO_NAME"
|
||||||
|
npm run build -- --base /$REPO_NAME/
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-pages-artifact@v3
|
uses: actions/upload-pages-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user