-
Notifications
You must be signed in to change notification settings - Fork 16
61 lines (51 loc) · 1.99 KB
/
docs.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
name: "docs"
permissions: {}
on:
pull_request:
# run "deploy-pages" job to deploy main branch to GitHub pages
push:
branches: [ "main" ]
jobs:
build-rustdoc:
name: "cargo doc"
permissions:
contents: read
runs-on: ubuntu-22.04
steps:
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- id: toolchain
uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a # doesn't have usual versioned releases/tags
with:
toolchain: nightly # minimal profile includes rustc component which includes cargo and rustdoc
- run: cargo +${{ steps.toolchain.outputs.name }} doc --verbose --no-deps --all-features
env:
RUSTDOCFLAGS: --crate-version ${{ github.event.pull_request.head.sha || github.sha }} -Z unstable-options --enable-index-page
- uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- name: Fix permissions
run: |
chmod -c -R +rX "target/doc/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: target/doc/
deploy-pages:
name: "deploy GitHub pages"
if: github.event_name == 'push'
permissions:
id-token: write
pages: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
needs: build-rustdoc
steps:
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit
- id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5