-
Notifications
You must be signed in to change notification settings - Fork 49
73 lines (66 loc) · 2.5 KB
/
Copy pathdoc.yml
File metadata and controls
73 lines (66 loc) · 2.5 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Deploy Doc
on:
push:
branches: [ main ]
# Makes it possible to run the workflow by hand from GitHub's interface.
workflow_dispatch:
jobs:
# Build job
build:
# Specify runner + build & upload the static files as an artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build static files
env:
CARGO_TERM_COLOR: always
run: |
cd charon
make doc
- name: Install rustc internal docs
run: |
rustup toolchain list -v
# Find toolchain path
export TOOLCHAIN=$(rustc --print sysroot)
echo "toolchain=\"$TOOLCHAIN\""
# Download rustc API docs
rustup component add rustc-docs
# Move the docs to deployment path
mv $TOOLCHAIN/share/doc/rust/html/rustc-docs charon/target/doc/rustc
- name: Prepare index.html
run: |
# Find toolchain name
export toolchain=$(rustc --print sysroot | grep -oP "nightly-\d{4}-\d{2}-\d{2}")
echo "toolchain=\"$toolchain\""
# Fill in toolchain placeholder in index.html
sed "s/nightly-xxxx-xx-xx/$toolchain/" .github/index.html > charon/target/doc/index.html
- name: Include benchmark dashboard from bench-reports
run: |
# Fetch the benchmark data that the bench workflow pushes to bench-reports.
if git fetch origin bench-reports 2>/dev/null; then
git checkout origin/bench-reports -- bench/ 2>/dev/null && \
mv bench/ charon/target/doc/bench/ && \
cp .github/bench-index.html charon/target/doc/bench/index.html || \
echo "No benchmark data on bench-reports yet, skipping."
else
echo "No bench-reports branch yet, skipping benchmark dashboard."
fi
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
with:
path: charon/target/doc/
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4