-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (56 loc) · 1.58 KB
/
build-and-deploy-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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Documentation
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
docs:
name: Build and deploy docs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v1
- name: Setup Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
# TODO: can I find some way to avoid needing these??
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libasound2-dev libudev-dev
version: 1.0
- name: Generate Docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --verbose --no-deps --keep-going --all-features --workspace -ptoy -pcommon
- name: Finalize documentation
run: |
echo '<meta http-equiv="refresh" content="0; url=https://manpat.github.io/toybox-rs/toybox/index.html">' > target/doc/index.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'target/doc'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@main