Add GitHub Pages deploy workflow; set Vite base path
2 changed files+43−0
.github/workflows/deploy.ymladded+41−0View file
@@ -0,0 +1,41 @@
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+# Allow one concurrent deployment, cancel in-progress runs.
14+concurrency:
15+ group: pages
16+ cancel-in-progress: true
17+
18+jobs:
19+ build:
20+ runs-on: ubuntu-latest
21+ steps:
22+ - uses: actions/checkout@v4
23+ - uses: actions/setup-node@v4
24+ with:
25+ node-version: 20
26+ cache: npm
27+ - run: npm ci
28+ - run: npm run build
29+ - uses: actions/upload-pages-artifact@v3
30+ with:
31+ path: dist
32+
33+ deploy:
34+ needs: build
35+ runs-on: ubuntu-latest
36+ environment:
37+ name: github-pages
38+ url: ${{ steps.deployment.outputs.page_url }}
39+ steps:
40+ - id: deployment
41+ uses: actions/deploy-pages@v4
vite.config.tsmodified+2−0View file
@@ -2,5 +2,7 @@ import {defineConfig} from 'vite'
22 import react from '@vitejs/plugin-react'
33
44 export default defineConfig({
5+ // Project pages are served from https://<org>.github.io/commonview/
6+ base: '/commonview/',
57 plugins: [react()]
68 })