Skip to content

Commit d0b78c5

Browse files
deploy to github pages
1 parent aa0ba2b commit d0b78c5

File tree

5 files changed

+80
-10
lines changed

5 files changed

+80
-10
lines changed

.github/workflows/deploy.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
# Trigger the workflow every time you push to the `main` branch
5+
# Using a different branch name? Replace `main` with your branch’s name
6+
push:
7+
branches: [master]
8+
9+
# Allows you to run this workflow manually from the Actions tab on GitHub.
10+
workflow_dispatch:
11+
12+
# Allow this job to clone the repo and create a page deployment
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
31+
- name: Install pnpm
32+
uses: pnpm/action-setup@v2
33+
with:
34+
version: 8
35+
36+
- name: Install Node.js
37+
uses: actions/setup-node@v3
38+
with:
39+
node-version: 18
40+
cache: pnpm
41+
42+
- name: Install dependencies
43+
run: pnpm install --frozen-lockfile
44+
45+
- name: Setup Pages
46+
uses: actions/configure-pages@v3
47+
with:
48+
static_site_generator: sveltekit
49+
50+
- name: Build
51+
run: pnpm run build
52+
53+
- name: Upload Artifacts
54+
uses: actions/upload-pages-artifact@v1
55+
with:
56+
# this should match the `pages` option in your adapter-static options
57+
path: 'build/'
58+
59+
deploy:
60+
needs: build
61+
runs-on: ubuntu-latest
62+
63+
environment:
64+
name: github-pages
65+
url: ${{ steps.deployment.outputs.page_url }}
66+
67+
steps:
68+
- name: Deploy
69+
id: deployment
70+
uses: actions/deploy-pages@v1

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"svelte": "^4.0.0"
5151
},
5252
"devDependencies": {
53-
"@sveltejs/adapter-auto": "^3.0.0",
53+
"@sveltejs/adapter-static": "^3.0.1",
5454
"@sveltejs/kit": "^2.0.0",
5555
"@sveltejs/package": "^2.0.0",
5656
"@sveltejs/vite-plugin-svelte": "^3.0.0",

pnpm-lock.yaml

+6-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/+layout.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export let prerender = true

svelte.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import adapter from '@sveltejs/adapter-auto'
1+
import adapter from '@sveltejs/adapter-static'
22
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
33

44
/** @type {import('@sveltejs/kit').Config} */
@@ -11,7 +11,7 @@ const config = {
1111
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
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.
14-
adapter: adapter(),
14+
adapter: adapter({ strict: false }),
1515

1616
alias: {
1717
'svelte-font-select': 'src/lib',

0 commit comments

Comments
 (0)