-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (61 loc) · 1.6 KB
/
push-to-gh-pages.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
name: Push to gh-pages
on:
push:
branches:
- main
workflow_dispatch:
jobs:
push-to-gh-pages:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: main
path: main
- uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Install latest Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
rustflags: '-W warnings'
- name: Setup jq
uses: dcarbone/[email protected]
with:
version: '1.6'
force: true
- name: Check json
run: |
cd main/nekolib-src
sh ls.sh
- name: Build documents
run: |
pwd
ls
pushd main/nekolib-doc
bash crates-ls.sh
RUSTDOCFLAGS="--html-in-header=$PWD/katex.html"
RUSTDOCFLAGS+=" --html-in-header=$PWD/crates-ls.html"
export RUSTDOCFLAGS
cargo d
popd
rm -rf gh-pages/docs
mv main/nekolib-doc/target/doc gh-pages/docs
- name: Commit changes
run: |
cd gh-pages
git status
git add .
git config user.name github-actions
git config user.email [email protected]
git commit -m '[auto-generated]' --allow-empty
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GA_TOKEN }}
branch: gh-pages
directory: gh-pages