Skip to content

Commit b3b165d

Browse files
authored
Add GitHub Actions workflow for documentation
1 parent 8686619 commit b3b165d

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
build:
12+
name: Build docs
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Setup pages
17+
id: pages
18+
uses: actions/configure-pages@v5
19+
- name: Clean docs folder
20+
run: cargo clean --doc
21+
- name: Build docs
22+
run: cargo doc --no-deps --document-private-items
23+
- name: Run tests
24+
run: cargo test --verbose
25+
- name: Add redirect
26+
run: echo '<meta http-equiv="refresh" content="0;url=aoc/index.html">' > target/doc/index.html
27+
- name: Remove lock file
28+
run: rm target/doc/.lock
29+
- name: Upload artifact
30+
uses: actions/upload-pages-artifact@v3
31+
with:
32+
path: target/doc
33+
34+
deploy:
35+
name: Deploy docs
36+
needs: build
37+
environment:
38+
name: github-pages
39+
url: ${{ steps.deployment.outputs.page_url }}
40+
runs-on: ubuntu-latest
41+
permissions:
42+
pages: write
43+
id-token: write
44+
steps:
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)