-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (62 loc) · 1.66 KB
/
documentation.yml
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
name: Documentation
on:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install rustup
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Generate documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --document-private-items
- name: Fix file permissions
shell: sh
run: |
chmod -c -R +rX "target/doc" |
while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Generate index.html file
run: |
echo "<meta http-equiv=refresh content=0;url=wasm_oidc_plugin/index.html>" > target/doc/index.html
- name: Upload documentation
uses: actions/upload-pages-artifact@v1
with:
path: ./target/doc
- name: Zip documentation
run: |
sudo apt-get update && sudo apt-get install -y zip
cd target/doc
zip -r docs .
cd ../..
- name: Archive documentation
uses: actions/upload-artifact@v4
with:
name: docs
path: target/doc/docs.zip
deploy:
name: Deploy documentation
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.pages.outputs.page_url }}
steps:
- name: Deploy documentation
id: pages
uses: actions/deploy-pages@v2