File tree 7 files changed +80
-3
lines changed
7 files changed +80
-3
lines changed Original file line number Diff line number Diff line change
1
+ # When publish a release. This workflow will trigger and deploy to site.
2
+
3
+ name : Deploy website
4
+ on :
5
+ create
6
+
7
+ permissions :
8
+ contents : read
9
+
10
+ jobs :
11
+ setup :
12
+ runs-on : ubuntu-latest
13
+ # if: github.event.ref_type == 'tag' && (contains(github.event.ref, '-') == false)
14
+ steps :
15
+ - name : checkout
16
+ uses : actions/checkout@v3
17
+
18
+ - name : cache package-lock.json
19
+ uses : actions/cache@v3
20
+ with :
21
+ path : package-temp-dir
22
+ key : lock-${{ github.sha }}
23
+
24
+ - name : create package-lock.json
25
+ run : npm i --package-lock-only --ignore-scripts
26
+
27
+ - name : hack for single file
28
+ run : |
29
+ if [ ! -d "package-temp-dir" ]; then
30
+ mkdir package-temp-dir
31
+ fi
32
+ cp package-lock.json package-temp-dir
33
+ - name : cache node_modules
34
+ id : node_modules_cache_id
35
+ uses : actions/cache@v3
36
+ with :
37
+ path : node_modules
38
+ key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
39
+
40
+ - name : install
41
+ if : steps.node_modules_cache_id.outputs.cache-hit != 'true'
42
+ run : npm ci
43
+
44
+ build-and-deploy :
45
+ runs-on : ubuntu-latest
46
+ needs : setup
47
+ steps :
48
+ - name : checkout
49
+ uses : actions/checkout@v3
50
+
51
+ - name : restore cache from package-lock.json
52
+ uses : actions/cache@v3
53
+ with :
54
+ path : package-temp-dir
55
+ key : lock-${{ github.sha }}
56
+
57
+ - name : restore cache from node_modules
58
+ uses : actions/cache@v3
59
+ with :
60
+ path : node_modules
61
+ key : node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
62
+
63
+ - name : build
64
+ run : npm run build
65
+
66
+ - name : deploy
67
+ uses : peaceiris/actions-gh-pages@v3
68
+ with :
69
+ github_token : ${{ secrets.GITHUB_TOKEN }}
70
+ deploy_key : ${{ secrets.ACTIONS_DEPLOY_KEY }}
71
+ publish_dir : ./dist
Original file line number Diff line number Diff line change 102
102
103
103
# TernJS port file
104
104
.tern-port
105
+
106
+ yarn.lock
Original file line number Diff line number Diff line change 4
4
< meta charset ="UTF-8 " />
5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6
6
< title > Ant Design Vue Playground</ title >
7
+ < link rel ="shortcut icon " type ="image/x-icon " href ="//aliyuncdn.antdv.com/favicon.ico " />
7
8
</ head >
8
9
< body >
9
10
< div id ="app "> </ div >
Original file line number Diff line number Diff line change 4
4
"description" : " " ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
7
- "dev" : " vite" ,
7
+ "dev" : " cross-env NODE_ENV=development vite" ,
8
8
"build" : " vite build" ,
9
9
"preview" : " vite preview"
10
10
},
29
29
"@types/node" : " 18.0.0" ,
30
30
"@vitejs/plugin-vue" : " 2.3.3" ,
31
31
"@vue/runtime-core" : " 3.2.37" ,
32
+ "cross-env" : " ^7.0.3" ,
32
33
"eslint" : " 8.18.0" ,
33
34
"typescript" : " 4.7.4" ,
34
35
"vite" : " 2.9.13"
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Sun from './icons/Sun.vue'
6
6
import Moon from ' ./icons/Moon.vue'
7
7
import Share from ' ./icons/Share.vue'
8
8
import GitHub from ' ./icons/GitHub.vue'
9
+ import logo from ' ../../public/logo.png'
9
10
const props = defineProps ([' store' , ' dev' , ' ssr' ])
10
11
const { store } = props
11
12
const activeVueVersion = ref (` ` )
@@ -59,7 +60,7 @@ onMounted(async () => {
59
60
<template >
60
61
<nav >
61
62
<h1 >
62
- <img alt =" logo" src =" / logo.svg " />
63
+ <img alt =" logo" : src =" logo" />
63
64
<span >Ant Design Vue Playground</span >
64
65
</h1 >
65
66
<div class =" links" >
Original file line number Diff line number Diff line change 1
1
import { defineConfig } from 'vite'
2
2
import vue from '@vitejs/plugin-vue'
3
-
3
+ console . log ( 'process.env.NODE_ENV' , process . env . NODE_ENV )
4
4
export default defineConfig ( {
5
5
plugins : [ vue ( ) ] ,
6
+ base : process . env . NODE_ENV === 'development' ? '/' : '/sfc-playground/' ,
6
7
define : {
7
8
__VUE_PROD_DEVTOOLS__ : JSON . stringify ( true )
8
9
} ,
You can’t perform that action at this time.
0 commit comments