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
name: Documentation
on:
push:
branches:
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-deploy:
name: Build and Deploy Documentation
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install MPI
run: |
sudo apt-get update
sudo apt-get install -y mpich libmpich-dev pkg-config
- name: Build documentation
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: "--cfg docsrs -D warnings"
- name: Add index redirect
run: |
cat > target/doc/index.html << 'EOF'
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=ferrompi/index.html">
<link rel="canonical" href="ferrompi/index.html">
</head>
<body>
<p>Redirecting to <a href="ferrompi/index.html">ferrompi documentation</a>...</p>
</body>
</html>
EOF
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
force_orphan: true
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
commit_message: "Deploy documentation for ${{ github.sha }}"