-
-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (52 loc) · 1.64 KB
/
document.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
name: 🧪 Document
on:
push:
branches:
- feat/ssg
pull_request:
branches:
- feat/ssg
release:
types: [created]
jobs:
all:
name: Document
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: hecrj/setup-rust-action@v2
with:
rust-version: nightly
- uses: actions/checkout@v4
- name: Update libssl
run: |
sudo apt-get update
sudo apt-get install -y libssl1.1
- name: Generate documentation for all features and publish it
run: |
RUSTDOCFLAGS="--cfg docsrs" \
cargo doc --no-deps --all-features --workspace
# Write index.html with redirect
echo '<html><head><meta http-equiv="refresh" content="0; url=/ssg/"></head><body></body></html>' > ./target/doc/index.html
- name: Deploy
uses: actions/upload-artifact@v4
with:
name: documentation
path: target/doc
if-no-files-found: error
retention-days: 1
- name: Write CNAME file
run: echo 'docs.shokunin.one' > ./target/doc/CNAME
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
publish_branch: gh-pages
cname: true
clean: true
commit_message: Deploy documentation at ${{ github.sha }}
commit_user_name: github-actions
commit_user_email: [email protected]