-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (64 loc) · 1.95 KB
/
docs-release.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
77
78
79
80
81
name: Documentation Deploy
on:
push:
branches:
- main
paths:
- 'src/**'
- 'justfile'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
# Build the documentation and upload as an artifact
docs-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust Nightly and Rust Docs
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2024-02-29
rustup component add rust-docs
- name: Rust Cache
uses: Swatinem/rust-cache@v2
id: cache-cargo
with:
prefix-key: ${{ runner.os }}-v3-cargo
shared-key: nightly-debug
key: ${{ hashFiles('Cargo.lock', 'Cargo.toml') }}
cache-provider: "github"
cache-directories: "~/.cargo/bin/"
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Set up Just
uses: extractions/setup-just@v2
- name: Generate docs
run: |
just doc -2024-02-29
echo "<meta http-equiv='refresh' content='0; URL=./stratus/'>" >> target/doc/index.html
chmod -c -R +rX target/doc/
- name: Upload docs artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'target/doc'
# Upload the documentation to GitHub Pages
docs-release:
runs-on: ubuntu-latest
needs: docs-build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download GH Pages artifact
uses: actions/download-artifact@v3
- name: Configure GH Pages
uses: actions/configure-pages@v3
- name: Deploy to GH Pages
id: deployment
uses: actions/deploy-pages@v2