Skip to content

Commit 33977bc

Browse files
committed
feat: switch to building with github actions and gh-pages branch
1 parent 8429551 commit 33977bc

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test, Build, and Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: 📥 Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: 🟢 Set up Node
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '22'
20+
21+
- name: 📦 Install dependencies
22+
run: npm ci
23+
24+
- name: 🧪 Run tests
25+
run: npm run test
26+
27+
- name: 🛠️ Build project
28+
run: npm run build
29+
30+
- name: 🚀 Deploy to GitHub Pages
31+
if: success()
32+
uses: peaceiris/actions-gh-pages@v3
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: ./dist

vite.config.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { defineConfig } from 'vite';
1+
import {defineConfig} from 'vite';
22
import react from '@vitejs/plugin-react-swc';
33
import svgr from 'vite-plugin-svgr';
44

55
// https://vitejs.dev/config/
66
export default defineConfig({
7-
plugins: [react(), svgr()],
8-
build: {
9-
outDir: 'docs',
10-
},
7+
plugins: [react(), svgr()],
8+
base: '/openwebcad/',
9+
build: {
10+
outDir: 'dist',
11+
},
1112
});

0 commit comments

Comments
 (0)