-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (67 loc) · 2.36 KB
/
Hamud_Book_Generate_zh-Hans-CN.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: zh-Hans-CN_CI
on:
push:
branches:
- '**'
- '!gh-pages'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
steps:
# Check
- uses: actions/checkout@v3
with:
ref: zh-Hans-CN
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: (test -x $HOME/.cargo/bin/mdbook || cargo install --vers "^0.4" mdbook)
- run: mdbook build && mdbook test
- run: |
echo '创建 tree/:'
mkdir /home/runner/tree
echo '复制 ./book/ 到 /home/runner/tree/zh-Hans-CN:'
ls ./book/
cp -v -u -r ./book/ /home/runner/tree/zh-Hans-CN
echo '检查 tree/zh-Hans-CN:'
ls /home/runner/tree/zh-Hans-CN
# HTML/CSS/JS Minifier
# - run: cd /home/runner/tree/zh-Hans-CN
# - uses: docker://devatherock/minify-js:2.0.0
# with:
# add_suffix: false # Optional
# Run merge zh-Hans-CN and gh-pages
- uses: actions/checkout@v3
with:
ref: gh-pages
- run: |
# echo '如果存在则删除 ./zh-Hans-CN:'
# if [ -d "./zh-Hans-CN/" ];then
rm -r ./zh-Hans-CN/
# else
# echo "文件夹不存在。"
# fi;
echo '复制 /home/runner/tree/zh-Hans-CN/ 到 ./zh-Hans-CN/:'
cp -v -u -r /home/runner/tree/zh-Hans-CN/ ./zh-Hans-CN/
ls ./zh-Hans-CN/
# - name: Generate the sitemap
# id: sitemap
# uses: cicirello/generate-sitemap@v1
# with:
# base-url-path: https://***/
# - name: Output sitemap stats
# run: |
# echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
# echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
# echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
# Deploy
- uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: . # The folder the action should deploy.
# - name: Ping Google
# run: curl https://www.google.com/ping?sitemap=https://***/sitemap.xml