-
Notifications
You must be signed in to change notification settings - Fork 86
61 lines (55 loc) · 1.81 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
name: Rustdoc
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-docs:
permissions:
contents: read
runs-on: ubuntu-latest-4-cores
steps:
- name: Checkout repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4
- name: Prep build on Ubuntu
uses: ./.github/actions/prep-ubuntu
with:
cache: enabled
# Cache needs Google credentials:
GWIP: ${{ secrets.GWIP_SCCACHE }}
GSA: ${{ secrets.GSA_SCCACHE }}
- name: Build documentation
id: build_docs
run: cargo doc --all --no-deps
env:
RUSTDOCFLAGS: "-D warnings"
RUSTC_WRAPPER: "sccache"
- name: Build Documentation failed
if: always() && steps.build_docs.outcome == 'failure'
run: echo ":::error::cargo doc --all --no-deps failed"
# Job will stop here and the check will be red if Build documentation failed
- name: Create Index file
if: github.ref == 'refs/heads/main'
run: |
echo "<meta http-equiv=\"refresh\" content=\"0; url=centrifuge_chain/index.html\">" \ > ./target/doc/index.html
- name: upload Docs files
uses: actions/upload-pages-artifact@v2
with:
path: ./target/doc
deploy-docs:
runs-on: ubuntu-latest
permissions:
pages: write # to deploy to Pages
id-token: write
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy Docs
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/deploy-pages@v2