Skip to content

Commit 01615a2

Browse files
committed
fix: Enhance SPA fallback logic in GitHub Pages deployment workflow
1 parent 257f12b commit 01615a2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/deploy-pages.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ jobs:
4040
run: |
4141
npm run build -- --configuration=production --output-path=dist/gh-pages --base-href "/${{ github.event.repository.name }}/"
4242
43-
- name: Add SPA fallback (404.html)
44-
run: cp dist/gh-pages/index.html dist/gh-pages/404.html
43+
- name: Add SPA fallback (404.html) if present
44+
run: |
45+
if [ -f dist/gh-pages/index.html ]; then
46+
cp dist/gh-pages/index.html dist/gh-pages/404.html
47+
else
48+
echo "index.html not found; skipping SPA fallback."
49+
fi
4550
4651
- name: Upload Pages artifact
4752
uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)