Skip to content

Commit 4f9274c

Browse files
committed
Refine Vite base path detection in GitHub Actions workflow: Updated deploy.yml to dynamically set the VITE_BASE variable based on whether the repository name ends with '.github.io', improving deployment accuracy for user sites.
1 parent 7752477 commit 4f9274c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ jobs:
5151
GITHUB_OWNER: ${{ github.repository_owner }}
5252
GITHUB_PROFILE_TYPE: user
5353
# Set Vite base path for GitHub Pages:
54-
# - user site (username.github.io) -> '/'
54+
# - user site (username.github.io) -> '/'
5555
# - project site (username.github.io/repo) -> '/repo/'
56-
VITE_BASE: ${{ github.repository_owner == github.event.repository.name && '/' || format('/{0}/', github.event.repository.name) }}
56+
# Detect user site by repo name ending with ".github.io".
57+
VITE_BASE: ${{ endsWith(github.event.repository.name, '.github.io') && '/' || format('/{0}/', github.event.repository.name) }}
5758
run: pnpm build
5859

5960
- name: Upload Pages artifact

0 commit comments

Comments
 (0)