1616 # vercel
1717 VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
1818 VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
19+ # Node / pnpm 版本与 package.json、.nvmrc 保持一致
20+ NODE_VERSION : 25.9.0
21+ PNPM_VERSION : 9.15.0
1922
2023# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
2124permissions :
@@ -27,32 +30,31 @@ jobs:
2730 # 部署到Github-Pages
2831 deploy-github :
2932 name : 部署到Github-Pages
30- runs-on : ubuntu-latest
33+ runs-on : ubuntu-24.04
3134 environment :
3235 name : github-pages
3336 url : ${{ steps.deployment.outputs.page_url }}
3437 if : github.repository == '142vip/JavaScriptCollection'
3538
3639 steps :
3740 - name : Checkout Code
38- uses : actions/checkout@v4
41+ uses : actions/checkout@v5
3942 with :
4043 persist-credentials : false
4144 # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
4245 fetch-depth : 0
4346
44- # 安装PNPM
47+ # 安装 PNPM(版本与 package.json packageManager 一致)
4548 - name : PNPM Install
46- uses : pnpm/action-setup@v4
49+ uses : pnpm/action-setup@v5
4750 with :
48- version : 9.15.0
51+ version : ${{ env.PNPM_VERSION }}
4952
50- # 安装Node环境
53+ # 安装 Node 环境(版本与 .nvmrc / engines.node 一致)
5154 - name : Install Node.js
52- uses : actions/setup-node@v4
55+ uses : actions/setup-node@v5
5356 with :
54- node-version : 20.16.0
55- # 缓存
57+ node-version : ${{ env.NODE_VERSION }}
5658 cache : pnpm
5759
5860 - name : Install Dependencies
@@ -64,42 +66,41 @@ jobs:
6466 run : pnpm build:proxy
6567
6668 - name : Upload artifact
67- uses : actions/upload-pages-artifact@v3
69+ uses : actions/upload-pages-artifact@v4
6870 with :
6971 path : .vuepress/dist
7072
7173 # 部署
7274 - name : Deploy to GitHub Pages
7375 id : deployment
74- uses : actions/deploy-pages@v4
76+ uses : actions/deploy-pages@v5
7577
7678 # 版本发布
7779 release :
7880 name : 创建Github发布
79- runs-on : ubuntu-latest
81+ runs-on : ubuntu-24.04
8082 # 主库next且执行release更新时执行
8183 if : github.repository == '142vip/JavaScriptCollection' && startsWith(github.event.head_commit.message, 'chore(release):')
8284
8385 steps :
8486 - name : Checkout Code
85- uses : actions/checkout@v4
87+ uses : actions/checkout@v5
8688 with :
8789 persist-credentials : false
8890 # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
8991 fetch-depth : 0
9092
91- # 安装PNPM
93+ # 安装 PNPM(版本与 package.json packageManager 一致)
9294 - name : PNPM Install
93- uses : pnpm/action-setup@v4
95+ uses : pnpm/action-setup@v5
9496 with :
95- version : 9.15.0
97+ version : ${{ env.PNPM_VERSION }}
9698
97- # 安装Node环境
99+ # 安装 Node 环境(版本与 .nvmrc / engines.node 一致)
98100 - name : Install Node.js
99- uses : actions/setup-node@v4
101+ uses : actions/setup-node@v5
100102 with :
101- node-version : 20.16.0
102- # 缓存
103+ node-version : ${{ env.NODE_VERSION }}
103104 cache : pnpm
104105
105106 - name : Install Dependencies
0 commit comments