File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,43 +2,55 @@ name: Deploy to GitHub Pages
22
33on :
44 push :
5- branches : [ main ]
6- pull_request :
7- branches : [ main ]
5+ branches : ' main'
86
97jobs :
10- build-and-deploy :
8+ build_site :
119 runs-on : ubuntu-latest
12-
10+ steps :
11+ - name : Checkout
12+ uses : actions/checkout@v4
13+
14+ # If you're using pnpm, add this step then change the commands and cache key below to use `pnpm`
15+ # - name: Install pnpm
16+ # uses: pnpm/action-setup@v3
17+ # with:
18+ # version: 8
19+
20+ - name : Install Node.js
21+ uses : actions/setup-node@v4
22+ with :
23+ node-version : 20
24+ cache : npm
25+
26+ - name : Install dependencies
27+ run : npm ci
28+
29+ - name : build
30+ env :
31+ BASE_PATH : ' /${{ github.event.repository.name }}'
32+ run : |
33+ npm run build
34+
35+ - name : Upload Artifacts
36+ uses : actions/upload-pages-artifact@v3
37+ with :
38+ # this should match the `pages` option in your adapter-static options
39+ path : ' build/'
40+
41+ deploy :
42+ needs : build_site
43+ runs-on : ubuntu-latest
44+
1345 permissions :
14- contents : read
1546 pages : write
1647 id-token : write
17-
48+
49+ environment :
50+ name : github-pages
51+ url : ${{ steps.deployment.outputs.page_url }}
52+
1853 steps :
19- - name : Checkout
20- uses : actions/checkout@v4
21-
22- - name : Setup Node.js
23- uses : actions/setup-node@v4
24- with :
25- node-version : ' 20'
26- cache : ' npm'
27-
28- - name : Install dependencies
29- run : npm ci
30-
31- - name : Build
32- run : npm run build
33-
34- - name : Setup Pages
35- uses : actions/configure-pages@v4
36-
37- - name : Upload artifact
38- uses : actions/upload-pages-artifact@v3
39- with :
40- path : ' ./build'
41-
42- - name : Deploy to GitHub Pages
43- id : deployment
44- uses : actions/deploy-pages@v4
54+ - name : Deploy
55+ id : deployment
56+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change @@ -12,12 +12,11 @@ const config = {
1212 // If your environment is not supported or you settled on a specific environment, switch out the adapter.
1313 // See https://kit.svelte.dev/docs/adapters for more information about adapters.
1414 adapter : adapter ( {
15- pages : 'build' ,
16- assets : 'build' ,
17- fallback : null ,
18- precompress : false ,
19- strict : true
20- } )
15+ fallback : '404.html' ,
16+ } ) ,
17+ paths : {
18+ base : process . argv . includes ( 'dev' ) ? '' : process . env . BASE_PATH
19+ }
2120 }
2221} ;
2322
You can’t perform that action at this time.
0 commit comments