File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : ci
22
33on :
4- # 每当 push 到 main 分支时触发部署
54 push :
65 branches : [master]
7- # 手动触发部署
86 workflow_dispatch :
97
8+ concurrency :
9+ group : ${{ github.workflow }}-${{ github.ref }}
10+ cancel-in-progress : true
11+
12+ permissions :
13+ contents : write
14+
1015jobs :
1116 docs :
1217 runs-on : ubuntu-latest
13- env :
14- HEXO_ALGOLIA_INDEXING_KEY : 7e2b35b929876e054ae115f1aae550bf
1518 steps :
1619 - uses : actions/checkout@v4
1720 with :
18- # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
1921 fetch-depth : 0
2022
2123 - name : Setup Node.js
2224 uses : actions/setup-node@v4
2325 with :
24- # 选择要使用的 node 版本
25- node-version : " 20 "
26- # 安装依赖
26+ node-version : " 24 "
27+ cache : " yarn "
28+
2729 - name : Install dependencies
28- if : steps.yarn-cache.outputs.cache-hit != 'true'
2930 run : yarn --frozen-lockfile
3031
31- - name : install algolia
32- run : yarn add algolia
3332
3433 - name : Build frontend
3534 run : yarn build
3635
37- - name : Get Algolia
36+ - name : Update Algolia Index
37+ env :
38+ HEXO_ALGOLIA_INDEXING_KEY : ${{ secrets.HEXO_ALGOLIA_INDEXING_KEY }}
3839 run : yarn algolia
3940
4041 - name : Deploy to GitHub Pages
41- uses : crazy-max/ghaction-github-pages@v3
42+ uses : crazy-max/ghaction-github-pages@v5
4243 with :
4344 target_branch : gh-pages
4445 build_dir : ./public
Original file line number Diff line number Diff line change 1313 "version" : " 8.1.1"
1414 },
1515 "dependencies" : {
16+ "algolia" : " ^0.0.0" ,
1617 "hexo" : " ^8.1.1" ,
1718 "hexo-algolia" : " ^1.3.2" ,
1819 "hexo-deployer-git" : " ^4.0.0" ,
You can’t perform that action at this time.
0 commit comments