-
Notifications
You must be signed in to change notification settings - Fork 159
83 lines (79 loc) · 2.7 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Docs
# Cancel workflow if there is a new change to the branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
on:
push:
branches:
- main
merge_group:
pull_request:
branches:
- main
env:
CACHE_TIMEOUT_MINUTES: 5
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
RUSTC_WRAPPER: "sccache"
jobs:
check-publish-docs:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Configure SCCache variables
run: |
# External PRs do not have access to 'vars' or 'secrets'.
if [[ "$AWS_ACCESS_KEY_ID" != "" ]]; then
echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV
echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV
echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV
fi
- name: Checkout Sources
uses: actions/checkout@v4
- name: Setup sccache
uses: mozilla-actions/[email protected]
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
- name: Link Checker (Repo Readme)
uses: lycheeverse/[email protected]
with:
args: 'README.md'
# Fail action on broken links
fail: true
- uses: hanabi1224/[email protected]
- name: Install MDBook
run: make install-doc-tools
env:
RUSTFLAGS: "-Cstrip=symbols"
- name: Execute MDBook
run: make mdbook-build
- name: Build vendored docs
run: make vendored-docs
env:
CC: "sccache clang"
CXX: "sccache clang++"
- name: Link Checker (Library Documentation)
uses: lycheeverse/[email protected]
with:
args: './target/doc/forest_filecoin/**/index.html'
# Fail action on broken links
fail: true
- name: Prepare rustdoc for publishing
run: mv ./target/doc ./documentation/book/html/rustdoc
# The deploy steps are identical expect for name and 'dry-run' attribute.
# Ideally this would be refactored.
- name: Deploy GH Pages (dry-run)
uses: JamesIves/[email protected]
if: ${{ github.event_name == 'pull_request' }}
with:
branch: gh-pages
folder: ./documentation/book/html/
dry-run: true
- name: Deploy GH Pages
uses: JamesIves/[email protected]
if: ${{ github.event_name == 'push' }}
with:
branch: gh-pages
folder: ./documentation/book/html/
dry-run: false