Skip to content

Commit be03360

Browse files
author
Ken Kawamoto
authored
CI: automate mdbook generaton (#29)
1 parent 17369a1 commit be03360

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3443
-2762
lines changed

.github/workflows/rust.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: mdbook updater
2+
3+
on:
4+
push
5+
6+
env:
7+
CARGO_TERM_COLOR: always
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
20+
- name: rust-mdbook
21+
uses: ryankurte/action-mdbook@0.1.1
22+
23+
# `ryankurte/action-mdbook@0.1.1` doesn't seem to respect
24+
# the argument `outputDir` which would specify the output directory.
25+
# Thus, explicitly rename here.
26+
- name: Rename
27+
run: |
28+
rm -rf docs
29+
mv book docs
30+
31+
- name: Git Commit docs
32+
run: |
33+
ref=${GITHUB_REF#refs/heads/}
34+
committer=$(git show -s --format='%ae')
35+
36+
# Although this guard seems unnecessary because git-push by a bot does not seem to trigger actions,
37+
# I'll keep it here for peace of my mind.
38+
if [ $committer != "rust-lang-ja.nomicon-admin@users.noreply.github.com" ]; then
39+
git config --global user.name 'Document updater'
40+
git config --global user.email 'rust-lang-ja.nomicon-admin@users.noreply.github.com'
41+
git add docs
42+
if git commit -m "Automated docs update"; then
43+
git fetch
44+
git merge origin/master
45+
git push origin HEAD:$ref
46+
fi
47+
fi

docs/arc-and-mutex.html

Lines changed: 47 additions & 39 deletions
Large diffs are not rendered by default.

docs/atomics.html

Lines changed: 48 additions & 40 deletions
Large diffs are not rendered by default.

docs/ayu-highlight.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ Original by Dempfi (https://github.com/dempfi/ayu)
1212
}
1313

1414
.hljs-comment,
15-
.hljs-quote,
16-
.hljs-meta {
15+
.hljs-quote {
1716
color: #5c6773;
1817
font-style: italic;
1918
}
@@ -30,6 +29,7 @@ Original by Dempfi (https://github.com/dempfi/ayu)
3029
}
3130

3231
.hljs-number,
32+
.hljs-meta,
3333
.hljs-builtin-name,
3434
.hljs-literal,
3535
.hljs-type,

0 commit comments

Comments
 (0)