Skip to content

Commit 813fd17

Browse files
authored
Merge pull request #26 from liamlaverty/development
Deploy
2 parents fa2ea46 + 79778f2 commit 813fd17

107 files changed

Lines changed: 20468 additions & 556 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# VLM Provider ("mistral" or "lmstudio")
2+
PROVIDER=mistral
3+
4+
# Mistral API key (required when PROVIDER=mistral)
5+
# Get your key at https://admin.mistral.ai/
6+
MISTRAL_API_KEY=your_api_key_here

.github/workflows/build-nextjs.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build Next.js Application
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- development
8+
paths:
9+
- 'src/viewer/**'
10+
- '.github/workflows/build-nextjs.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
- development
15+
paths:
16+
- 'src/viewer/**'
17+
- '.github/workflows/build-nextjs.yml'
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
23+
defaults:
24+
run:
25+
working-directory: src/viewer
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '20'
35+
36+
- name: Setup pnpm
37+
uses: pnpm/action-setup@v4
38+
with:
39+
version: 9.15.0
40+
41+
- name: Get pnpm store directory
42+
shell: bash
43+
run: |
44+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
45+
46+
- name: Setup pnpm cache
47+
uses: actions/cache@v4
48+
with:
49+
path: ${{ env.STORE_PATH }}
50+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
51+
restore-keys: |
52+
${{ runner.os }}-pnpm-store-
53+
54+
- name: Install dependencies
55+
run: pnpm install --frozen-lockfile
56+
57+
- name: Check formatting
58+
run: pnpm run format:check
59+
60+
- name: Run linter
61+
run: pnpm run lint
62+
63+
- name: Run type check
64+
run: pnpm run type-check
65+
66+
- name: Run tests
67+
run: pnpm run test
68+
69+
- name: Build Next.js application
70+
run: pnpm run build
71+
72+
- name: Upload build artifacts
73+
uses: actions/upload-artifact@v4
74+
if: success()
75+
with:
76+
name: nextjs-build
77+
path: src/viewer/.next
78+
retention-days: 7
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Deploy Next.js to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'src/viewer/**'
9+
- '.github/workflows/deploy-nextjs-gh-pages.yml'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
defaults:
26+
run:
27+
working-directory: src/viewer
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '20'
37+
38+
- name: Setup pnpm
39+
uses: pnpm/action-setup@v4
40+
with:
41+
version: 9.15.0
42+
43+
- name: Get pnpm store directory
44+
shell: bash
45+
run: |
46+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
47+
48+
- name: Setup pnpm cache
49+
uses: actions/cache@v4
50+
with:
51+
path: ${{ env.STORE_PATH }}
52+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
53+
restore-keys: |
54+
${{ runner.os }}-pnpm-store-
55+
56+
- name: Install dependencies
57+
run: pnpm install --frozen-lockfile
58+
59+
- name: Build Next.js application
60+
run: pnpm run build
61+
env:
62+
NODE_ENV: production
63+
64+
- name: Add .nojekyll file
65+
run: touch out/.nojekyll
66+
67+
- name: Upload artifact
68+
uses: actions/upload-pages-artifact@v3
69+
with:
70+
path: src/viewer/out
71+
72+
deploy:
73+
environment:
74+
name: github-pages
75+
url: ${{ steps.deployment.outputs.page_url }}
76+
runs-on: ubuntu-latest
77+
needs: build
78+
steps:
79+
- name: Deploy to GitHub Pages
80+
id: deployment
81+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ cython_debug/
182182
.abstra/
183183

184184
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
185+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186186
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
187+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188188
# you could uncomment the following to ignore the entire vscode folder
189189
# .vscode/
190190

@@ -220,6 +220,6 @@ output/
220220
.Trashes
221221
ehthumbs.db
222222
Thumbs.db
223-
.github/copilot-instructions.md
223+
.github/*instructions.md
224224

225-
test_output/
225+
test_output/

.husky/pre-commit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
# Minify viewer_data.json files
4+
echo "Minifying viewer_data.json files..."
5+
python scripts/minify_viewer_data.py || exit 1
6+
7+
# Run viewer pre-commit checks
8+
cd src/viewer && pnpm run pre-commit

0 commit comments

Comments
 (0)