-
-
Notifications
You must be signed in to change notification settings - Fork 2k
55 lines (46 loc) · 1.44 KB
/
docs-rust.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
name: Build Rust documentation
on:
pull_request:
paths:
- crates/**
- .github/workflows/docs-rust.yml
push:
branches:
- main
paths:
- crates/**
- .github/workflows/docs-rust.yml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
build-rust-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup component add rust-docs
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref_name == 'main' }}
- name: Build Rust documentation
env:
RUSTDOCFLAGS: --cfg docsrs -D warnings --allow=rustdoc::redundant-explicit-links
working-directory: crates
run: make doctest
- name: Create redirect to Polars crate and set no-jekyll
if: ${{ github.ref_name == 'main' }}
run: |
echo '<meta http-equiv=refresh content=0;url=polars/index.html>' > target/doc/index.html
touch target/doc/.nojekyll
- name: Deploy Rust docs
if: ${{ github.ref_name == 'main' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: target/doc
target-folder: api/rust/dev
single-commit: true
# Make sure documentation artifacts are not cached
- name: Clean up documentation artifacts
if: ${{ github.ref_name == 'main' }}
run: rm -rf target/doc