1
1
name : Build
2
2
3
3
on :
4
+ workflow_dispatch :
4
5
push :
5
6
branches :
6
7
- master
@@ -31,36 +32,37 @@ jobs:
31
32
ssh-keyscan github.com >> ~/.ssh/known_hosts
32
33
git config --global user.name $GIT_USERNAME
33
34
git config --global user.email $GIT_EMAIL
34
-
35
+
35
36
- name : Configure Hexo Unit Test # 配置 Hexo 单元测试
36
37
run : |
37
- git clone https://github.com/hexojs/hexo-theme-unit-test.git unit_test
38
- git clone https://github.com/Lhcfl/hexo-theme-anatolo.git unit_test/themes/Anatolo
39
- cd unit_test/themes/Anatolo
38
+ git clone https://github.com/hexojs/hexo-theme-unit-test.git ~/unit_test
39
+ mkdir -p ~/unit_test/themes/Anatolo
40
+ cp -r ./* ~/unit_test/themes/Anatolo/
41
+ cd ~/unit_test/themes/Anatolo
40
42
pnpm i
41
- cd ../../..
42
- cp ./.github/asserts/anatolo_config.yml unit_test/themes/Anatolo/_config.yml
43
- cp ./.github/asserts/hexo_config.yml unit_test/_config.yml
44
- cp ./.github/asserts/_posts/* unit_test/source/_posts/
45
- cd unit_test
43
+ cd /home/runner/work/hexo-theme-anatolo/hexo-theme-anatolo
44
+ cp ./.github/asserts/anatolo_config.yml ~/ unit_test/themes/Anatolo/_config.yml
45
+ cp ./.github/asserts/hexo_config.yml ~/ unit_test/_config.yml
46
+ cp ./.github/asserts/_posts/* ~/ unit_test/source/_posts/
47
+ cd ~/ unit_test
46
48
npm install
47
49
npm install hexo-renderer-pug --save
48
50
npm install hexo-renderer-stylus --save
49
51
npx hexo new "Anatolo简介"
50
- cat .. /README.md >> ./source/_posts/Anatolo简介.md
51
-
52
+ cat /home/runner/work/hexo-theme-anatolo/hexo-theme-anatolo /README.md >> ./source/_posts/Anatolo简介.md
53
+
52
54
- name : Generate Test # 生成 Hexo 单元测试
53
55
run : |
54
- cd unit_test
56
+ cd ~/ unit_test
55
57
npx hexo g -b
56
58
57
59
- name : Commit And Push Blog # 提交到Git仓库
58
60
env :
59
61
GIT_URL :
' [email protected] :Lhcfl/Anatolodemo.git'
60
62
run : |
61
- cd unit_test/public
63
+ cd ~/ unit_test/public
62
64
git init
63
65
git remote add origin $GIT_URL
64
66
git add -A
65
67
git commit -m "Auto generated."
66
- git push origin HEAD:master --force
68
+ git push origin HEAD:master --force
0 commit comments