-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.42 KB
/
gen_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
46
47
48
49
50
51
52
53
54
55
56
57
name: generate document
on:
push:
branches:
- doc
paths:
- 'trigger/gen_doc'
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: doc
path: doc
- uses: actions/checkout@v2
with:
repository: rsk0315/rsk0315.github.io
path: gh
token: ${{ secrets.GH_TOKEN }}
- name: Install latest Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Generate doc
run: |
rm -Rf gh/library-rs
mkdir gh/library-rs
cd doc/gen/generated
cargo d
cd target/doc
cp -R * ../../../../../gh/library-rs/
cd ../../../../../gh/library-rs
git add .
git config user.name github-actions
git config user.email [email protected]
git commit -m '[auto-generated]' || true
- name: Push to github.io
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
with:
source-directory: gh
destination-github-username: 'rsk0315'
destination-repository-name: 'rsk0315.github.io'
user-name: 'github-actions'
user-email: '[email protected]'
target-branch: master