-
Notifications
You must be signed in to change notification settings - Fork 9
65 lines (53 loc) · 1.7 KB
/
docs.yml
File metadata and controls
65 lines (53 loc) · 1.7 KB
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
name: Documentation
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
pages: write
id-token: write
jobs:
docs:
name: Build Documentation
runs-on: ubuntu-latest
environment: ${{ github.ref == 'refs/heads/main' && 'github-pages' || null }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-docs-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build documentation
run: |
# Create directory structure for dual documentation
mkdir -p target/doc-final/{cloud,embedded}
# Build cloud/edge documentation
cargo doc --features "std,tokio-runtime,tracing,metrics" --no-deps
cp -r target/doc/* target/doc-final/cloud/
# Build embedded documentation
cargo doc --no-default-features --features "embassy-runtime" --no-deps
cp -r target/doc/* target/doc-final/embedded/
# Copy main index page
cp docs/index.html target/doc-final/index.html
- name: Setup Pages
if: github.ref == 'refs/heads/main'
uses: actions/configure-pages@v4
- name: Upload artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: ./target/doc-final
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/deploy-pages@v4