Skip to content

Commit 514d77f

Browse files
committed
ci: adapt base href
1 parent 2044e20 commit 514d77f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,17 @@ jobs:
3131
- name: Install dependencies
3232
run: npm ci
3333

34+
- name: Compute base href
35+
id: base-href
36+
run: |
37+
if [ "${{ github.event.repository.name }}" = "${{ github.repository_owner }}.github.io" ]; then
38+
echo "value=/" >> $GITHUB_OUTPUT
39+
else
40+
echo "value=/${{ github.event.repository.name }}/" >> $GITHUB_OUTPUT
41+
fi
42+
3443
- name: Build
35-
run: npm run build
44+
run: npm run build -- --base-href="${{ steps.base-href.outputs.value }}"
3645

3746
- name: Deploy
3847
uses: JamesIves/github-pages-deploy-action@v4

0 commit comments

Comments
 (0)