Skip to content

Commit 615bb0a

Browse files
BeiyanYunyiLhcfl
authored andcommitted
ci: 💚 relax, and test ci
1 parent 453410f commit 615bb0a

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

.github/workflows/test_and_build.yml

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Build
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- master
@@ -31,36 +32,37 @@ jobs:
3132
ssh-keyscan github.com >> ~/.ssh/known_hosts
3233
git config --global user.name $GIT_USERNAME
3334
git config --global user.email $GIT_EMAIL
34-
35+
3536
- name: Configure Hexo Unit Test # 配置 Hexo 单元测试
3637
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
4042
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
4648
npm install
4749
npm install hexo-renderer-pug --save
4850
npm install hexo-renderer-stylus --save
4951
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+
5254
- name: Generate Test # 生成 Hexo 单元测试
5355
run: |
54-
cd unit_test
56+
cd ~/unit_test
5557
npx hexo g -b
5658
5759
- name: Commit And Push Blog # 提交到Git仓库
5860
env:
5961
GIT_URL: '[email protected]:Lhcfl/Anatolodemo.git'
6062
run: |
61-
cd unit_test/public
63+
cd ~/unit_test/public
6264
git init
6365
git remote add origin $GIT_URL
6466
git add -A
6567
git commit -m "Auto generated."
66-
git push origin HEAD:master --force
68+
git push origin HEAD:master --force

0 commit comments

Comments
 (0)