-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (40 loc) · 1.52 KB
/
docs.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
name: Docs
on: [push]
jobs:
rustdoc:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
CARGO_TERM_COLOR: always
NUM_JOBS: 2
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Build documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --all-features
- name: Prepare HTML
run: |
mkdir -p ./public/
# The ./target/doc/ directory has assets one level above the index.html, but it
# requires relative links, so we redirect to it from one level higher.
echo '<meta http-equiv="refresh" content="0; url=ag_iso_stack">' >./public/index.html
cp -r target/doc/* ./public/
# TODO: Replace with docs.rs once crate publishing is figured out
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public/
force_orphan: true