Skip to content

Commit

Permalink
Add homepage and GitHub Pages deployment
Browse files Browse the repository at this point in the history
A homepage link has been added to the README.md and package.json file. The GitHub Actions configuration has been updated to support deploying of the application to GitHub Pages. The Svelte compiler has also been switched from auto adapter to static adapter for more flexibility in deploying static sites.
  • Loading branch information
lemo-nade-room committed Jun 9, 2024
1 parent 458592d commit e9ccedf
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/homepage-deploy.yaml
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

- uses: oven-sh/setup-bun@v1

- run: bun install

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

- 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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ To publish your library to [npm](https://www.npmjs.com):
npm publish
```

## HomePage

https://lemo-nade-room.github.io/svelte-diff-highlighting

## License

This software is released under the MIT License. For more details, please refer to the [LICENSE](./LICENSE) file.
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"repository": {
"url": "https://github.com/lemo-nade-room/svelte-diff-highlighting"
},
"homepage": "https://lemo-nade-room.github.io/svelte-diff-highlighting",
"license": "MIT",
"scripts": {
"dev": "vite dev",
Expand Down Expand Up @@ -35,6 +36,7 @@
"devDependencies": {
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/package": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
Expand Down
9 changes: 7 additions & 2 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 @@ -11,7 +11,12 @@ const config = {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter(),
adapter: adapter({
fallback: '404.html'
}),
paths: {
base: process.argv.includes('dev') ? '' : process.env.BASE_PATH
},
alias: {
$sample: './src/sample'
}
Expand Down

0 comments on commit e9ccedf

Please sign in to comment.