Skip to content

Commit f0d7023

Browse files
committed
Add GitHub Pages documentation deployment workflow
1 parent 2dcffe0 commit f0d7023

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
build-docs:
15+
name: Build and Deploy Documentation
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: dtolnay/rust-toolchain@stable
21+
22+
- uses: Swatinem/rust-cache@v2
23+
with:
24+
cache-on-failure: true
25+
26+
- name: Build documentation
27+
run: |
28+
cargo doc --no-deps --all-features --document-private-items
29+
echo '<meta http-equiv="refresh" content="0; url=crabgraph/index.html">' > target/doc/index.html
30+
31+
- name: Deploy to GitHub Pages
32+
uses: peaceiris/actions-gh-pages@v3
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: ./target/doc
36+
force_orphan: true

0 commit comments

Comments
 (0)