diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..6fac23d --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,43 @@ +name: Deploy to GitHub Pages +on: + push: + branches: 'main' +jobs: + build_site: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + # If you're using pnpm, add this step then change the commands and cache key below to use `pnpm` + # - name: Install pnpm + # uses: pnpm/action-setup@v3 + # with: + # version: 8 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - name: Install dependencies + run: npm install + - name: build + run: | + npm run build + - name: Upload Artifacts + uses: actions/upload-pages-artifact@v3 + with: + # this should match the `pages` option in your adapter-static options + path: 'build/' + deploy: + needs: build_site + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/package-lock.json b/package-lock.json index 879633a..485a376 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ }, "devDependencies": { "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/adapter-static": "^3.0.2", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", "@types/eslint": "^9.6.0", @@ -1065,6 +1066,16 @@ "@sveltejs/kit": "^2.0.0" } }, + "node_modules/@sveltejs/adapter-static": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.2.tgz", + "integrity": "sha512-/EBFydZDwfwFfFEuF1vzUseBoRziwKP7AoHAwv+Ot3M084sE/HTVBHf9mCmXfdM9ijprY5YEugZjleflncX5fQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@sveltejs/kit": "^2.0.0" + } + }, "node_modules/@sveltejs/kit": { "version": "2.5.18", "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.5.18.tgz", diff --git a/package.json b/package.json index 0fc0c5c..a36b6ce 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ }, "devDependencies": { "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/adapter-static": "^3.0.2", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", "@types/eslint": "^9.6.0", diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts new file mode 100644 index 0000000..c8cacf0 --- /dev/null +++ b/src/routes/+layout.server.ts @@ -0,0 +1 @@ +export const prerender = true; \ No newline at end of file diff --git a/svelte.config.js b/svelte.config.js index 98cd8a5..471caa4 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,10 +1,15 @@ -import adapter from '@sveltejs/adapter-auto'; +import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */ const config = { kit: { - adapter: adapter() + adapter: adapter({ + fallback: '404.html' + }), + paths: { + base: '' + } }, preprocess: vitePreprocess() };