-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (75 loc) · 2.48 KB
/
docs.yml
File metadata and controls
88 lines (75 loc) · 2.48 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Deploy Documentation
on:
push:
branches: [ main ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Build documentation
run: cargo doc --workspace --no-deps --all-features
env:
RUSTDOCFLAGS: "--enable-index-page -Zunstable-options"
- name: Create index.html redirect
run: |
cat > target/doc/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=tp_lib_core/index.html">
<title>TP-Lib Documentation</title>
</head>
<body>
<h1>TP-Lib Documentation</h1>
<p>Redirecting to <a href="tp_lib_core/index.html">tp_lib_core documentation</a>...</p>
<ul>
<li><a href="tp_lib_core/index.html">tp-core: Core library for geospatial transformations</a></li>
<li><a href="tp_lib_cli/index.html">tp-cli: Command-line interface</a></li>
<li><a href="tp_lib_py/index.html">tp-py: Python bindings</a></li>
</ul>
</body>
</html>
EOF
- name: Add .nojekyll file
run: touch target/doc/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: target/doc
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4