-
Notifications
You must be signed in to change notification settings - Fork 47
85 lines (67 loc) · 2.29 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
84
85
name: Deploy Docs
on:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: --html-in-header header.html
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build-and-deploy:
if: github.repository == 'prefix-dev/rattler-build'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.68.0
- name: Setup Pages
uses: actions/configure-pages@v3
# This does the following:
# - Replaces the docs icon with one that clearly denotes it's not the released package on crates.io
# - Adds a meta tag that forces Google not to index any page on the site.
- name: Pre-docs-build
run: |
echo "<meta name=\"robots\" content=\"noindex\">" > header.html
- uses: Swatinem/rust-cache@v2
- name: Build Documentation
run: cargo doc --workspace --no-deps --all-features
- name: Build Book
run: mdbook build
# This adds the following:
# - A top level redirect to the bevy crate documentation
# - A robots.txt file to forbid any crawling of the site (to defer to the docs.rs site on search engines).
# - A .nojekyll file to disable Jekyll GitHub Pages builds.
- name: Finalize documentation
run: |
mkdir final_docs
touch final_docs/.nojekyll
echo "<meta http-equiv=\"refresh\" content=\"0; url=rattler/index.html\">" > target/doc/index.html
mkdir -p final_docs/reference
mv target/doc/* final_docs/reference
mv book/* final_docs/
echo "User-Agent: *\nDisallow: /" > final_docs/robots.txt
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'final_docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2