File tree Expand file tree Collapse file tree 4 files changed +68
-1
lines changed Expand file tree Collapse file tree 4 files changed +68
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy Demo
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 : false
16
+
17
+ env :
18
+ NODE_VERSION : 22
19
+
20
+ jobs :
21
+ deploy :
22
+ environment :
23
+ name : github-pages
24
+ url : ${{ steps.deployment.outputs.page_url }}
25
+
26
+ runs-on : ubuntu-latest
27
+ steps :
28
+ - name : Checkout
29
+ uses : actions/checkout@v4
30
+
31
+ - name : Use Node.js ${{ env.NODE_VERSION }}
32
+ uses : actions/setup-node@v4
33
+ with :
34
+ node-version : ${{ env.NODE_VERSION }}
35
+ cache : ' npm'
36
+
37
+ - name : Install dependencies
38
+ run : npm ci
39
+
40
+ - name : Build Demo
41
+ run : npm run build:demo
42
+
43
+ - name : Setup Pages
44
+ uses : actions/configure-pages@v5
45
+
46
+ - name : Upload artifact for Github page
47
+ uses : actions/upload-pages-artifact@v3
48
+ with :
49
+ path : ' demo'
50
+
51
+ - name : Deploy to GitHub Pages
52
+ id : deployment
53
+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change @@ -22,3 +22,5 @@ dist-ssr
22
22
* .njsproj
23
23
* .sln
24
24
* .sw ?
25
+
26
+ demo /
Original file line number Diff line number Diff line change 31
31
"lint" : " eslint ." ,
32
32
"lint-fix" : " eslint . --fix" ,
33
33
"preview" : " vite preview" ,
34
- "prepare" : " husky && npm run build"
34
+ "prepare" : " husky && npm run build" ,
35
+ "build:demo" : " vite build --config vite-demo.config.ts"
35
36
},
36
37
"lint-staged" : {
37
38
"*" : " eslint --fix"
Original file line number Diff line number Diff line change
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react'
3
+
4
+ export default defineConfig ( {
5
+ plugins : [ react ( ) ] ,
6
+ base : './' ,
7
+ build : {
8
+ outDir : 'demo' ,
9
+ emptyOutDir : true ,
10
+ } ,
11
+ } )
You can’t perform that action at this time.
0 commit comments