Skip to content

Commit 23a5206

Browse files
Chore(ci): Add deploy script
1 parent 6cbd8ce commit 23a5206

6 files changed

Lines changed: 68 additions & 3 deletions

File tree

.github/workflows/check.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ on:
44
push:
55
branches:
66
- main
7+
78
pull_request:
89

10+
workflow_call:
11+
912
jobs:
1013
lint:
1114
runs-on: ubuntu-latest
@@ -67,6 +70,9 @@ jobs:
6770
- name: Install dependencies
6871
run: pnpm install --frozen-lockfile
6972

73+
- name: Build Demo
74+
run: pnpm turbo run build --filter="@istex/viewer-demo"
75+
7076
- name: Install dependencies
7177
run: pnpm playwright install chromium chromium-headless-shell
7278

.github/workflows/deloy.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy Demo to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
check:
20+
uses: ./.github/workflows/check.yml@main
21+
22+
deploy:
23+
runs-on: ubuntu-latest
24+
needs:
25+
- check
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v5
32+
33+
- name: Set up Node
34+
uses: actions/setup-node@v3
35+
with:
36+
node-version: '24.x'
37+
38+
- name: Setup pnpm
39+
uses: pnpm/action-setup@v4
40+
41+
- name: Install dependencies
42+
run: pnpm install --frozen-lockfile
43+
44+
- name: Build Demo
45+
run: pnpm turbo run build --filter="@istex/viewer-demo" --no-cache
46+
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: './packages/demo/dist'
51+
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"[typescriptreact]": {
2525
"editor.defaultFormatter": "biomejs.biome"
2626
},
27+
"[yaml]": {
28+
"editor.defaultFormatter": "biomejs.biome"
29+
},
2730
"files.exclude": {
2831
"**/.DS_Store": true,
2932
"**/.turbo": true,

packages/demo/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import vitePluginDevtoolsJson from "vite-plugin-devtools-json";
44
import viteTsConfigPaths from "vite-tsconfig-paths";
55

66
const config = defineConfig({
7+
base: "/istex-view/",
78
server: {
89
port: 3000,
910
},

packages/e2e/playwright.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const command = process.env.DEV
44
? 'pnpm turbo run --filter="@istex/viewer-demo" dev'
55
: 'pnpm turbo run --filter="@istex/viewer-demo" preview';
66
const baseURL = process.env.DEV
7-
? "http://localhost:3000"
8-
: "http://localhost:8000";
7+
? "http://localhost:3000/istex-view"
8+
: "http://localhost:8000/istex-view";
99

1010
export default defineConfig({
1111
testDir: "./src",
@@ -28,7 +28,7 @@ export default defineConfig({
2828

2929
webServer: {
3030
command,
31-
url: baseURL,
31+
url: `${baseURL}/`,
3232
reuseExistingServer: !process.env.CI,
3333
},
3434
});

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
packages:
22
- packages/*
33

4+
catalogMode: prefer
45
catalog:
56
'@biomejs/biome': ^2.3.8
67
'@emotion/react': ^11.14.0

0 commit comments

Comments
 (0)