Skip to content

Commit c6d278d

Browse files
committed
Add RustDoc GitHub Pages Workflow
1 parent 3636256 commit c6d278d

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/rustdoc.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
release:
9+
name: GitHub Pages
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v1
19+
20+
- name: Install Rust toolchain
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
profile: minimal
25+
override: true
26+
components: rustfmt, rust-src
27+
28+
- name: Build Documentation
29+
uses: actions-rs/cargo@v1
30+
with:
31+
command: doc
32+
args: --all --no-deps
33+
34+
- name: Add redirect to project docs index page
35+
run: >
36+
echo "<meta http-equiv=\"refresh\" content=\"0; url=cec_dpms/index.html\">" > target/doc/index.html
37+
38+
- name: Deploy
39+
uses: peaceiris/actions-gh-pages@v3
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
publish_dir: ./target/doc
43+
destination_dir: docs
44+
exclude_assets: '.github,.vscode,target,tests'

0 commit comments

Comments
 (0)