File tree Expand file tree Collapse file tree 2 files changed +22
-17
lines changed Expand file tree Collapse file tree 2 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 13
13
14
14
# 当前流程要执行的任务,可以是多个。[my_first_job]就是一个任务
15
15
jobs :
16
- my_first_job :
16
+ build :
17
17
name : build-and-deploy
18
18
runs-on : ubuntu-latest
19
19
24
24
version : 6.32.9
25
25
- uses : actions/setup-node@v4
26
26
with :
27
- node-version : ' 14 '
27
+ node-version : ' 20 '
28
28
cache : ' pnpm'
29
29
30
30
- name : install
@@ -33,18 +33,18 @@ jobs:
33
33
- name : Run Build Script
34
34
run : pnpm build
35
35
36
- - name : Deploy to GitHub Pages
37
- # 此actions的官方文档 https://github.com/JamesIves/github-pages-deploy-action
38
- uses : JamesIves/github-pages-deploy-action@v4
36
+ - name : Upload artifact
37
+ uses : actions/upload-pages-artifact@v3
39
38
with :
40
- # 要部署的文件夹,必填
41
- folder : dist
42
- # 希望部署的分支,默认gh-pages
43
- branch : gh-pages
44
- # # 仓库范围的访问令牌,可以将个人令牌的值存储在GitHub Secrets中
45
- # # 默认情况是不需要填的,如果您需要更多权限,例如部署到另一个存储库才需要填写
46
- # # ACCESS_TOKEN 对应GitHub Secrets中设置的字段,不要照搬
47
- token : ${{ secrets.ACCESS_TOKEN }}
48
- # # 部署到GitHub的不同仓库 <用户名>/<仓库名>
49
- # # 此选项必须配置了TOKEN才能正常执行
50
- # REPOSITORY-NAME: leoleor/leo2
39
+ path : ./dist
40
+ # Deployment job
41
+ deploy :
42
+ environment :
43
+ name : github-pages
44
+ url : ${{ steps.deployment.outputs.page_url }}
45
+ runs-on : ubuntu-latest
46
+ needs : build
47
+ steps :
48
+ - name : Deploy to GitHub Pages
49
+ id : deployment
50
+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change @@ -6,12 +6,13 @@ import AutoImport from 'unplugin-auto-import/vite'
6
6
import Components from 'unplugin-vue-components/vite'
7
7
import Icons from 'unplugin-icons/vite'
8
8
// import basicSsl from '@vitejs/plugin-basic-ssl'
9
+ import deletePlugin from 'rollup-plugin-delete'
9
10
import Unocss from 'unocss/vite'
10
11
import { presetUno , presetAttributify , presetIcons } from 'unocss'
11
12
import { PrimeVueResolver } from '@primevue/auto-import-resolver'
12
13
13
14
// https://vitejs.dev/config/
14
- export default ( { mode, command } ) => {
15
+ export default ( { mode } ) => {
15
16
// const env = loadEnv(mode, process.cwd())
16
17
return defineConfig ( {
17
18
base : './' ,
@@ -68,6 +69,10 @@ export default ({ mode, command }) => {
68
69
} ) ,
69
70
Icons ( {
70
71
compiler : 'vue3'
72
+ } ) ,
73
+ deletePlugin ( {
74
+ targets : [ 'dist/del' ] ,
75
+ hook : 'writeBundle'
71
76
} )
72
77
] ,
73
78
resolve : {
You can’t perform that action at this time.
0 commit comments