Skip to content

Commit

Permalink
GitHub Pages deploy test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpey committed Nov 26, 2024
1 parent a497002 commit bd01e76
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main

jobs:
build_and_deploy:
runs-on: ubuntu-latest

permissions:
pages: write

steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Install dependencies
run: npm ci

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

- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/

- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
8 changes: 4 additions & 4 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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 @@ -8,10 +8,10 @@ const config = {
preprocess: vitePreprocess(),

kit: {
// 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()
},
paths: {
base: process.argv.includes('dev') ? '' : process.env.BASE_PATH
}
};

Expand Down

0 comments on commit bd01e76

Please sign in to comment.