Repository navigation
54 lines (47 loc) · 1.73 KB
/
Copy pathdocs.yml
File metadata and controls
54 lines (47 loc) · 1.73 KB
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
name: Docs
on:
push:
branches: [main]
workflow_dispatch:
jobs:
generate-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Cache dependencies
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.lock') }}
# docs.sh -> build.sh -> wasm-opt
- name: Ensure wasm-opt
run: ./scripts/wasm-opt.sh --ensure-tool
- name: Build documentation
# the `--enable-index-page` flag creates an index.html file at the root of the docs
# the `-Zunstable-options` flag is needed to use `--enable-index-page`
# see https://github.com/rust-lang/cargo/issues/8229 for why `nightly` is needed
run: ./scripts/docs.sh
- name: Upload documentation files as artifact
id: docs-artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: target/doc
retention-days: 10
deploy-docs-pages:
permissions:
id-token: write # Needed for OIDC authentication
pages: write # this permission is needed for deploying into Github Pages
environment:
name: github-pages
url: ${{ steps.docs-artifact.outputs.page_url }}
runs-on: ubuntu-latest
needs: generate-documentation
steps:
- name: Deploy to Documentation to GitHub Pages
id: docs-artifact
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5