forked from hermit-os/kernel
50 lines (46 loc) · 1.41 KB
/
publish.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
name: Build docs
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rust-src
override: true
- name: Generate documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: -Z build-std=core,alloc,panic_abort -Z build-std-features=compiler-builtins-mem --target x86_64-unknown-hermit-kernel.json
- name: Generate index.html
run: |
cat > target/x86_64-unknown-hermit-kernel/doc/index.html <<EOL
<!doctype html>
<html>
<head>
<title>Redirect!</title>
<meta http-equiv="refresh" content="0; url=https://hermitcore.github.io/libhermit-rs/hermit/" />
</head>
<body>
<p><a href="https://hermitcore.github.io/libhermit-rs/hermit/">Redirect</a></p>
</body>
</html>
EOL
- name: Deploy documentation
if: success()
uses: crazy-max/ghaction-github-pages@v2.3.0
with:
target_branch: gh-pages
build_dir: target/x86_64-unknown-hermit-kernel/doc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}