Skip to content

Commit a55f806

Browse files
authored
Merge pull request #2 from cookie0o/main
sync
2 parents 4a734f6 + 0f096de commit a55f806

7 files changed

Lines changed: 87 additions & 18 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: 'web'
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: '/${{ 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+
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

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ node_modules
55
.vercel
66
.netlify
77
.wrangler
8-
/.svelte-kit
98
/build
9+
.svelte-kit
1010

1111
# OS
1212
.DS_Store

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"dev": "vite dev",
88
"build": "vite build",
99
"preview": "vite preview",
10+
"deploy": "gh-pages -d build -t",
1011
"prepare": "svelte-kit sync || echo ''",
1112
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
1213
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
@@ -21,14 +22,16 @@
2122
"@sveltejs/kit": "^2.16.0",
2223
"@sveltejs/vite-plugin-svelte": "^5.0.0",
2324
"@tailwindcss/vite": "^4.0.0",
25+
"@types/node": "^22.15.2",
2426
"prettier": "^3.4.2",
2527
"prettier-plugin-svelte": "^3.3.3",
2628
"prettier-plugin-tailwindcss": "^0.6.11",
2729
"svelte": "^5.0.0",
2830
"svelte-check": "^4.0.0",
2931
"tailwindcss": "^4.0.0",
3032
"typescript": "^5.0.0",
31-
"vite": "^6.2.5"
33+
"vite": "^6.2.5",
34+
"gh-pages": "^6.3.0"
3235
},
3336
"dependencies": {
3437
"@lucide/svelte": "^0.503.0"

src/routes/+layout.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const prerender = true;
2+
export const trailingSlash = "always";

src/routes/+layout.svelte

Lines changed: 0 additions & 7 deletions
This file was deleted.

svelte.config.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import adapter from '@sveltejs/adapter-static';
2-
import { vitePreprocess } from '@sveltejs/kit/vite';
1+
import adapter from "@sveltejs/adapter-static";
32

43
/** @type {import('@sveltejs/kit').Config} */
54
const config = {
6-
kit: {
7-
appDir: 'web',
8-
adapter: adapter(),
9-
paths: {
10-
base: dev ? '' : process.env.BASE_PATH,
11-
}
5+
kit: {
6+
adapter: adapter(),
7+
paths: {
8+
base: process.env.NODE_ENV === "production" ? "/Pool-viewer" : "",
9+
relative: false
1210
},
13-
preprocess: vitePreprocess()
11+
},
1412
};
13+
1514
export default config;

0 commit comments

Comments
 (0)