File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -2,19 +2,14 @@ name: Deploy to GitHub Pages
22
33on :
44 push :
5- branches : [main] # or 'master' depending on your repo
5+ branches : [main]
66
77permissions :
88 contents : write
99
1010jobs :
1111 build_and_deploy :
1212 runs-on : ubuntu-latest
13-
14- defaults :
15- run :
16- working-directory : htmltoolkit
17-
1813 steps :
1914 - name : Checkout repo
2015 uses : actions/checkout@v4
@@ -25,13 +20,19 @@ jobs:
2520 node-version : 20
2621
2722 - name : Install dependencies
28- run : npm ci
23+ run : cd htmltoolkit && npm ci
2924
3025 - name : Build the site
31- run : npm run build
26+ run : cd htmltoolkit && npm run build
27+
28+ - name : Rename 200.html to 404.html for GitHub Pages SPA fallback
29+ run : |
30+ if [ -f htmltoolkit/build/200.html ]; then
31+ mv htmltoolkit/build/200.html htmltoolkit/build/404.html
32+ fi
3233
3334 - name : Deploy to GitHub Pages
3435 uses : JamesIves/github-pages-deploy-action@v4
3536 with :
36- branch : gh-pages # Target branch
37- folder : htmltoolkit/build # Path from root to built site
37+ branch : gh-pages
38+ folder : htmltoolkit/build
Original file line number Diff line number Diff line change @@ -18,7 +18,9 @@ const config = {
1818 ] ,
1919
2020 kit : {
21- adapter : adapter ( ) ,
21+ adapter : adapter ( {
22+ fallback : '200.html' // Add fallback here
23+ } ) ,
2224 paths : {
2325 base : dev ? '' : '/htmltoolkit.github.io' ,
2426 } ,
You can’t perform that action at this time.
0 commit comments