-
Notifications
You must be signed in to change notification settings - Fork 71
100 lines (81 loc) · 2.4 KB
/
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: pages
on:
push:
branches:
- master
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTFLAGS: "-D warnings"
RUSTUP_MAX_RETRIES: 10
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
build:
if: github.repository == 'redbadger/crux'
runs-on: ubuntu-latest
steps:
- name: Checkout (latest)
uses: actions/checkout@v4
with:
path: latest
- name: Checkout (stable)
uses: actions/checkout@v4
with:
ref: book-stable
path: stable
- uses: dtolnay/rust-toolchain@stable
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: Setup mdBook
uses: jontze/action-mdbook@v3
with:
token: ${{secrets.GITHUB_TOKEN}}
use-linkcheck: true
use-admonish: true
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build Documentation (latest)
working-directory: latest
run: cargo doc --all --no-deps
- name: Build Documentation (stable)
working-directory: stable
run: cargo doc --all --no-deps
- name: Build book (latest)
working-directory: latest/docs
run: mdbook build
- name: Build book (stable)
working-directory: stable/docs
run: mdbook build
- name: Move outputs
run: |
set -e
mkdir -p ./public/latest_master
mv latest/target/doc ./public/latest_master/master_api_docs
mv latest/docs/book/html/* ./public/latest_master/
mv stable/target/doc ./public/master_api_docs
mv stable/docs/book/html/* ./public/
- name: Upload GitHub Pages artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: public/
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: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4