-
Notifications
You must be signed in to change notification settings - Fork 81
61 lines (57 loc) · 1.71 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
51
52
53
54
55
56
57
58
59
60
61
name: Build docs
on:
push:
branches:
- master
jobs:
publish:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly]
include:
- os: ubuntu-latest
rust: 'nightly'
components: 'rust-src, llvm-tools-preview'
targets: 'x86_64-unknown-linux-gnu'
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
components: ${{ matrix.components || '' }}
targets: ${{ matrix.targets || '' }}
- uses: actions/checkout@v2
with:
submodules: true
- name: Check Cargo availability
run: cargo --version
- name: Install nasm
run: sudo apt-get update --fix-missing && sudo apt-get install nasm
- name: Generate documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --workspace -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit
- name: Generate index.html
run: |
cat > target/x86_64-unknown-hermit/doc/index.html <<EOL
<!doctype html>
<html>
<head>
<title>Redirect!</title>
<meta http-equiv="refresh" content="0; url=https://hermitcore.github.io/rusty-hermit/hermit_abi/" />
</head>
<body>
<p><a href="https://hermitcore.github.io/rusty-hermit/hermit_abi/">Redirect</a></p>
</body>
</html>
EOL
- name: Deploy documentation
if: success()
uses: crazy-max/ghaction-github-pages@v1
with:
target_branch: gh-pages
build_dir: target/x86_64-unknown-hermit/doc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}