File tree Expand file tree Collapse file tree 1 file changed +47
-19
lines changed Expand file tree Collapse file tree 1 file changed +47
-19
lines changed Original file line number Diff line number Diff line change 1
- name : Deploy Website
1
+ name : Deploy Hexo site to Pages
2
2
3
3
on :
4
+ # Runs on pushes targeting the `master` branch
4
5
push :
5
- branches :
6
- - main
6
+ branches : [master]
7
+
8
+ # Allows manual trigger from the Actions tab
9
+ workflow_dispatch :
10
+
11
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12
+ permissions :
13
+ contents : read
14
+ pages : write
15
+ id-token : write
16
+
17
+ # Allow only one concurrent deployment, skipping queued runs
18
+ concurrency :
19
+ group : pages
20
+ cancel-in-progress : false
7
21
8
22
jobs :
9
- build-and-deploy :
23
+ # Build job
24
+ build :
10
25
runs-on : ubuntu-latest
11
-
12
26
steps :
13
- # 检出代码
14
- - name : Checkout code
15
- uses : actions/checkout@v3
27
+ # Check out the code
28
+ - name : Checkout
29
+ uses : actions/checkout@v4
16
30
17
- # 设置 Node.js 环境
18
- - name : Setup Node.js
19
- uses : actions/setup-node@v3
31
+ # Set up Node.js environment
32
+ - name : Setup Node
33
+ uses : actions/setup-node@v4
20
34
with :
21
35
node-version : ' lts/*'
36
+ cache : npm
22
37
23
- # 安装依赖
38
+ # Install dependencies
24
39
- name : Install dependencies
25
40
run : |
26
41
npm install
42
+ npm install -g hexo-cli
27
43
npm install hexo-theme-stellar
28
44
npm audit fix
29
45
30
- # 生成静态文件
31
- - name : Generate static files
46
+ # Generate static files with Hexo
47
+ - name : Build with Hexo
32
48
run : hexo generate
33
49
34
- # 部署到 GitHub Pages
35
- - name : Deploy to GitHub Pages
36
- uses : peaceiris/ actions-gh- pages@v3
50
+ # Upload artifact
51
+ - name : Upload artifact
52
+ uses : actions/upload- pages-artifact @v3
37
53
with :
38
- github_token : ${{ secrets.GITHUB_TOKEN }}
39
- publish_dir : ./public
54
+ path : ./public
55
+
56
+ # Deployment job
57
+ deploy :
58
+ environment :
59
+ name : github-pages
60
+ url : ${{ steps.deployment.outputs.page_url }}
61
+ needs : build
62
+ runs-on : ubuntu-latest
63
+ name : Deploy
64
+ steps :
65
+ - name : Deploy to GitHub Pages
66
+ id : deployment
67
+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments