Skip to content

Commit a5786b5

Browse files
committed
fix: base url
Signed-off-by: Aritra Dey <[email protected]>
1 parent 63f33bd commit a5786b5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/publish-docs.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,18 @@ jobs:
3232
with:
3333
node-version: 20
3434

35+
- name: Calculate BASE_URL
36+
run: |
37+
if [[ "${{ github.event.repository.name }}" == "${{ github.repository_owner }}.github.io" ]]; then
38+
echo "BASE_URL=/pr-preview/pr-${{ github.event.pull_request.number }}/" >> $GITHUB_ENV
39+
else
40+
echo "BASE_URL=/${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.pull_request.number }}/" >> $GITHUB_ENV
41+
fi
42+
3543
- name: Install and Build
3644
run: npm ci && npm run build
45+
env:
46+
BASE_URL: ${{ env.BASE_URL }}
3747

3848
- name: Deploy Preview
3949
uses: rossjrw/pr-preview-action@v1

0 commit comments

Comments
 (0)