-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (45 loc) · 1.26 KB
/
doc.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
name: Generate doc for gh-pages
on:
push:
branches:
- master
jobs:
doc:
runs-on: ubuntu-18.04
steps:
- name: Checkout source code branch
uses: actions/checkout@v2
- name: Apt install
run: |
sudo apt update -yqq
sudo apt install -yqq curl libcurl4 git-core doxygen build-essential ruby-bundler llvm-9 libclang1-9
- name: Prepare for Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.38.0
default: true
- name: Prepare for cargo
run: |
cargo install --force cbindgen
- name: Generate doc
run: |
export PATH="$PATH:/usr/lib/llvm-9/bin"
make doc
tar -zcf /tmp/qiniu_ng.tar.gz -C target doc
- name: Switch to gh-pages
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Prepare for gh-pages
run: |
tar xf /tmp/qiniu_ng.tar.gz -C .
rm /tmp/qiniu_ng.tar.gz
git add doc
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'Update docs' || true
- name: Push gh-pages changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}