Skip to content

Commit dde52fe

Browse files
committed
Updated action
1 parent ef6f20e commit dde52fe

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Deploy to GitHub Pages
44

55
on:
66
push:
7-
branches: 'main'
7+
branches: "main"
88

99
jobs:
1010
build_site:
@@ -30,15 +30,15 @@ jobs:
3030

3131
- name: build
3232
env:
33-
BASE_PATH: '/${{ github.event.repository.name }}'
33+
BASE_PATH: "/${{ github.event.repository.name }}"
3434
run: |
3535
npm run build
3636
3737
- name: Upload Artifacts
3838
uses: actions/upload-pages-artifact@v3
3939
with:
4040
# this should match the `pages` option in your adapter-static options
41-
path: 'build/'
41+
path: "build/"
4242

4343
deploy:
4444
needs: build_site
@@ -55,4 +55,5 @@ jobs:
5555
steps:
5656
- name: Deploy
5757
id: deployment
58-
uses: actions/deploy-pages@v4
58+
uses: actions/deploy-pages@v4
59+

svelte.config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
2-
import adapter from "@sveltejs/adapter-auto";
2+
import adapter from "@sveltejs/adapter-static";
33

44
/** @type {import('@sveltejs/kit').Config} */
55
const config = {
66
preprocess: [vitePreprocess()],
77
kit: {
8-
adapter: adapter(),
8+
adapter: adapter({
9+
pages: 'build',
10+
assets: 'build',
11+
fallback: '404.html',
12+
precompress: false,
13+
strict: true
14+
}),
15+
paths: {
16+
base: process.env.BASE_PATH
17+
}
918
},
1019
};
1120

vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ import { sveltekit } from '@sveltejs/kit/vite';
33
import { defineConfig } from 'vite';
44

55
export default defineConfig({
6-
plugins: [tailwindcss(), sveltekit()]
6+
plugins: [tailwindcss(), sveltekit()],
7+
base: process.env.BASE_PATH
78
});

0 commit comments

Comments
 (0)