1
- # # CD交付流水线
2
- # # - 部署到Github Pages
3
- # # - 部署到Vercel托管平台
4
- # # - 发布新的Github Release
5
- # # 参考资料:https://v2.vuepress.vuejs.org/zh/guide/deployment.html#github-pages
1
+ # CD交付流水线
2
+ # - 部署到Github Pages
3
+ # - 部署到Vercel托管平台
4
+ # - 发布新的Github Release
5
+ # 参考资料:https://v2.vuepress.vuejs.org/zh/guide/deployment.html#github-pages
6
6
7
7
name : CD
8
8
on :
13
13
14
14
# 环境变量
15
15
env :
16
- # # vercel
16
+ # vercel
17
17
VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
18
18
VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
19
19
20
20
jobs :
21
- # # 部署到Github-Pages
21
+ # 部署到Github-Pages
22
22
deploy-github :
23
- name : " 部署到Github-Pages"
23
+ name : 部署到Github-Pages
24
24
if : github.repository == '142vip/JavaScriptCollection'
25
25
runs-on : ubuntu-latest
26
26
@@ -32,21 +32,21 @@ jobs:
32
32
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
33
33
fetch-depth : 0
34
34
35
- # # 安装PNPM
35
+ # 安装PNPM
36
36
- name : PNPM Install
37
- uses : pnpm/action-setup@v2
37
+ uses : pnpm/action-setup@v4
38
38
with :
39
- version : 8
39
+ version : 9.6.0
40
40
41
- # # 安装Node环境
41
+ # 安装Node环境
42
42
- name : Install Node.js
43
- uses : actions/setup-node@v3
43
+ uses : actions/setup-node@v4
44
44
with :
45
- node-version : 18.18 .0
46
- # # 淘宝镜像加速
45
+ node-version : 20.16 .0
46
+ # 淘宝镜像加速
47
47
registry-url : ' https://registry.npmmirror.com'
48
- # # 缓存
49
- cache : ' pnpm'
48
+ # 缓存
49
+ cache : pnpm
50
50
51
51
- name : Install Dependencies
52
52
run : |
@@ -67,15 +67,15 @@ jobs:
67
67
with :
68
68
pages_threshold : major_outage
69
69
70
- # # 获取Git提交信息
70
+ # 获取Git提交信息
71
71
- name : Get Commit Info
72
72
id : gitInfo
73
73
run : |
74
74
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
75
75
echo "author=$(git log -1 --pretty=%an)" >> $GITHUB_OUTPUT
76
76
echo "email=$(git log -1 --pretty=%ae)" >> $GITHUB_OUTPUT
77
77
78
- # # 参考:https://github.com/marketplace/actions/github-pages
78
+ # 参考:https://github.com/marketplace/actions/github-pages
79
79
- name : Deploy To GitHub Page
80
80
uses : crazy-max/ghaction-github-pages@v3
81
81
with :
@@ -90,40 +90,40 @@ jobs:
90
90
env :
91
91
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92
92
93
- # # 部署到vercel平台
94
- # deploy-vercel:
95
- # name: "部署到Vercel平台"
96
- # needs: install-init
97
- # runs-on: ubuntu-latest
98
- # if: github.repository == '142vip/JavaScriptCollection'
99
- # steps:
100
- # - name: Checkout Code
101
- # uses: actions/checkout@v3
102
- # with:
103
- # fetch-depth: 0
104
- #
105
- # - name: Restore Dependencies From Cache
106
- # uses: actions/cache@v3
107
- # with:
108
- # path: |
109
- # node_modules
110
- # key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
111
- #
112
- # - name: Pull Vercel Environment Information
113
- # run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
114
- #
115
- # ## 注意:安装pnpm
116
- # - name: Build Project Artifacts
117
- # run: npm i pnpm@7 -g && vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
118
- #
119
- # - name: Deploy Project Artifacts to Vercel
120
- # run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
121
-
122
- # # 版本发布
93
+ # 部署到vercel平台
94
+ # deploy-vercel:
95
+ # name: "部署到Vercel平台"
96
+ # needs: install-init
97
+ # runs-on: ubuntu-latest
98
+ # if: github.repository == '142vip/JavaScriptCollection'
99
+ # steps:
100
+ # - name: Checkout Code
101
+ # uses: actions/checkout@v3
102
+ # with:
103
+ # fetch-depth: 0
104
+ #
105
+ # - name: Restore Dependencies From Cache
106
+ # uses: actions/cache@v3
107
+ # with:
108
+ # path: |
109
+ # node_modules
110
+ # key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
111
+ #
112
+ # - name: Pull Vercel Environment Information
113
+ # run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
114
+ #
115
+ # ## 注意:安装pnpm
116
+ # - name: Build Project Artifacts
117
+ # run: npm i pnpm@7 -g && vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
118
+ #
119
+ # - name: Deploy Project Artifacts to Vercel
120
+ # run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
121
+
122
+ # 版本发布
123
123
release :
124
- name : " 创建Github发布"
124
+ name : 创建Github发布
125
125
runs-on : ubuntu-latest
126
- # # 主库next且执行release更新时执行
126
+ # 主库next且执行release更新时执行
127
127
if : github.repository == '142vip/JavaScriptCollection' && startsWith(github.event.head_commit.message, 'chore(release):')
128
128
129
129
steps :
@@ -134,12 +134,12 @@ jobs:
134
134
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
135
135
fetch-depth : 0
136
136
137
- # ## 打成压缩包
137
+ # ## 打成压缩包
138
138
- name : Create Zip Package
139
139
run : |
140
140
zip -r JavaScriptCollection.zip . \
141
141
-x "node_modules/*" \
142
- -x "*.git*"
142
+ -x "*.git*"
143
143
144
144
# 提取版本号
145
145
- name : Get New Version Number
@@ -158,12 +158,12 @@ jobs:
158
158
release_name : v${{ steps.releaseVersion.outputs.version }}
159
159
body : |
160
160
Release ${{ steps.releaseVersion.outputs.version }}
161
-
161
+
162
162
### Features
163
163
164
164
### Bug Fixes
165
165
166
- # # 更新资源
166
+ # 更新资源
167
167
- name : Upload Resource Assets
168
168
uses : actions/upload-release-asset@latest
169
169
env :
@@ -205,4 +205,4 @@ jobs:
205
205
# echo "-----------正在运行的服务--------"
206
206
# docker ps
207
207
# cd /service_env/ && git reset --hard && git pull origin main
208
- # bash ./scripts/book_doc.deploy.sh jsc ${{steps.version.outputs.value}}
208
+ # bash ./scripts/book_doc.deploy.sh jsc ${{steps.version.outputs.value}}
0 commit comments