-
Notifications
You must be signed in to change notification settings - Fork 10
75 lines (72 loc) · 2.17 KB
/
gh-pages.yaml
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
name: gh-pages
on:
push:
branches:
- "main"
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v2
# caution: this is the same restore as in ci.yaml
- name: Restore Cargo Cache
id: cargo-cache
uses: actions/cache/restore@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
# We can do this now because we use specific verison and update with Dependabot
# but if we make the deps any less specifc, we'll have to fix
key: ${{ runner.os }}-deps-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/*.rs') }}
# start from the previous set of cached dependencies
restore-keys: |
${{ runner.os }}-deps-${{ hashFiles('**/Cargo.toml') }}-
${{ runner.os }}-deps-
- name: Build
run: cargo doc --document-private-items --no-deps
- name: Set up _site redirect to firewood
run: |
rm -fr _site
mkdir _site
echo "<meta http-equiv=\"refresh\" content=\"0; url=firewood\">" > _site/index.html
- name: Copy doc files to _site
run: |
cp -rv target/doc/* ./_site
cp -rv docs/assets ./_site
- uses: actions/upload-artifact@v3
with:
name: pages
path: _site
if-no-files-found: error
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Download pages artifact
uses: actions/[email protected]
with:
name: pages
path: .
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: .
- name: Deploy to GitHub pages
id: deployment
uses: actions/deploy-pages@v2