File tree 3 files changed +61
-0
lines changed
3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy to GitHub Pages
2
+
3
+ on :
4
+ push :
5
+ branches : ' main'
6
+
7
+ jobs :
8
+ build_site :
9
+ runs-on : ubuntu-latest
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 install
28
+
29
+ - name : build
30
+ env :
31
+ BASE_PATH : ' /my-svelte-portfolio'
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
+
45
+ permissions :
46
+ pages : write
47
+ id-token : write
48
+
49
+ environment :
50
+ name : github-pages
51
+ url : ${{ steps.deployment.outputs.page_url }}
52
+
53
+ steps :
54
+ - name : Deploy
55
+ id : deployment
56
+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 1
1
import adapter from "@sveltejs/adapter-node" ;
2
2
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte" ;
3
3
4
+ const dev = process . argv . includes ( "dev" ) ;
5
+
4
6
/** @type {import('@sveltejs/kit').Config } */
5
7
const config = {
6
8
kit : {
7
9
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
8
10
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
9
11
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
10
12
adapter : adapter ( ) ,
13
+ paths : {
14
+ base : dev ? "" : process . env . BASE_PATH ,
15
+ } ,
11
16
} ,
12
17
preprocess : vitePreprocess ( ) ,
13
18
} ;
You can’t perform that action at this time.
0 commit comments