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 1313
1414# 当前流程要执行的任务,可以是多个。[my_first_job]就是一个任务
1515jobs :
16- my_first_job :
16+ build :
1717 name : build-and-deploy
1818 runs-on : ubuntu-latest
1919
2424 version : 6.32.9
2525 - uses : actions/setup-node@v4
2626 with :
27- node-version : ' 14 '
27+ node-version : ' 20 '
2828 cache : ' pnpm'
2929
3030 - name : install
@@ -33,18 +33,18 @@ jobs:
3333 - name : Run Build Script
3434 run : pnpm build
3535
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
3938 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'
66import Components from 'unplugin-vue-components/vite'
77import Icons from 'unplugin-icons/vite'
88// import basicSsl from '@vitejs/plugin-basic-ssl'
9+ import deletePlugin from 'rollup-plugin-delete'
910import Unocss from 'unocss/vite'
1011import { presetUno , presetAttributify , presetIcons } from 'unocss'
1112import { PrimeVueResolver } from '@primevue/auto-import-resolver'
1213
1314// https://vitejs.dev/config/
14- export default ( { mode, command } ) => {
15+ export default ( { mode } ) => {
1516 // const env = loadEnv(mode, process.cwd())
1617 return defineConfig ( {
1718 base : './' ,
@@ -68,6 +69,10 @@ export default ({ mode, command }) => {
6869 } ) ,
6970 Icons ( {
7071 compiler : 'vue3'
72+ } ) ,
73+ deletePlugin ( {
74+ targets : [ 'dist/del' ] ,
75+ hook : 'writeBundle'
7176 } )
7277 ] ,
7378 resolve : {
You can’t perform that action at this time.
0 commit comments