File tree Expand file tree Collapse file tree 2 files changed +43
-3
lines changed
Expand file tree Collapse file tree 2 files changed +43
-3
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy Website
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ build-and-deploy :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ # 检出代码
14+ - name : Checkout code
15+ uses : actions/checkout@v3
16+
17+ # 设置 Node.js 环境
18+ - name : Setup Node.js
19+ uses : actions/setup-node@v3
20+ with :
21+ node-version : ' lts/*'
22+
23+ # 安装依赖
24+ - name : Install dependencies
25+ run : |
26+ npm install
27+ npm install hexo-theme-stellar
28+ npm audit fix
29+
30+ # 生成静态文件
31+ - name : Generate static files
32+ run : hexo generate
33+
34+ # 部署到 GitHub Pages
35+ - name : Deploy to GitHub Pages
36+ uses : peaceiris/actions-gh-pages@v3
37+ with :
38+ github_token : ${{ secrets.GITHUB_TOKEN }}
39+ publish_dir : ./public
Original file line number Diff line number Diff line change @@ -11,20 +11,21 @@ node: 14.17.3 ~ 20.10.0 # 建议选择 LTS 版本,过高的版本 hexo 还
1111npm: 6.14.13 ~ 10.2.3
1212```
1313
14-
1514之后在` _config.yml ` 所在文件夹安装hexo-stellar(如果存在包问题则使用` npm audit fix ` 修复):
1615
1716```
1817npm i hexo-theme-stellar
1918npm audit fix
2019```
2120
22-
23-
2421最后按照Hexo的正常逻辑生成并本地启动即可。
2522
2623```
2724hexo g
2825hexo s
2926```
3027
28+ ## 自动化部署(GitHub Actions)
29+
30+ 项目已配置 GitHub Actions 自动化部署。当代码推送到 ` main ` 分支时,GitHub Actions 会自动生成静态文件并部署到 GitHub Pages.
31+
You can’t perform that action at this time.
0 commit comments