Skip to content

Commit

Permalink
Configure deployment to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaOrson committed Dec 26, 2024
1 parent b9d4cb2 commit e2640e9
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm install

- name: build
env:
BASE_PATH: '/${{ github.event.repository.name }}'
run: npm run build

- name: Upload Artifacts
uses: actions/upload-pages-artifact@v3
with:
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-static": "^3.0.8",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/package": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
Expand Down
8 changes: 6 additions & 2 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import adapter from '@sveltejs/adapter-auto';
// import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
Expand All @@ -11,7 +12,10 @@ const config = {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter()
adapter: adapter(),
paths: {
base: process.env.BASE_PATH
},
}
};

Expand Down

0 comments on commit e2640e9

Please sign in to comment.