Skip to content

Commit 02f93a2

Browse files
authored
Merge pull request #3 from openseadragon/ig-action
Added deploy action and prettier config
2 parents 281eae3 + c89d8a6 commit 02f93a2

4 files changed

Lines changed: 67 additions & 18 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 'lts/*'
25+
cache: npm
26+
- run: npm ci
27+
- run: npm run build
28+
- uses: actions/upload-pages-artifact@v3
29+
with:
30+
path: dist
31+
32+
deploy:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
environment:
36+
name: github-pages
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
steps:
39+
- id: deployment
40+
uses: actions/deploy-pages@v4

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "none",
6+
"printWidth": 100
7+
}

public/404.html

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<title>OpenSeadragon</title>
6-
<script>
7-
// GitHub Pages SPA redirect: store the full URL and bounce to the base path.
8-
// The main index.html restores the path via history.replaceState on load.
9-
var base = '/new-website/';
10-
var path = location.pathname.slice(base.length - 1) + location.search + location.hash;
11-
sessionStorage.setItem('osd_spa_redirect', path);
12-
location.replace(base);
13-
</script>
14-
</head>
15-
<body></body>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>OpenSeadragon</title>
6+
<script>
7+
// GitHub Pages SPA redirect: store the full URL and bounce to the base path.
8+
// The main index.html restores the path via history.replaceState on load.
9+
// NOTE: This base path must match the base path in vite.config.js and the name of the repository.
10+
var base = '/website/';
11+
var path = location.pathname.slice(base.length - 1) + location.search + location.hash;
12+
sessionStorage.setItem('osd_spa_redirect', path);
13+
location.replace(base);
14+
</script>
15+
</head>
16+
<body></body>
1617
</html>

vite.config.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import { defineConfig } from 'vite'
2-
import vue from '@vitejs/plugin-vue'
3-
import { fileURLToPath, URL } from 'node:url'
1+
import { defineConfig } from 'vite';
2+
import vue from '@vitejs/plugin-vue';
3+
import { fileURLToPath, URL } from 'node:url';
44

55
export default defineConfig({
66
plugins: [vue()],
7-
base: '/new-website/',
7+
// NOTE: This base path must match the base path in 404.html and the name of the repository.
8+
base: '/website/',
89
resolve: {
910
alias: {
1011
'@': fileURLToPath(new URL('./src', import.meta.url))
1112
}
1213
}
13-
})
14+
});

0 commit comments

Comments
 (0)