-
-
Notifications
You must be signed in to change notification settings - Fork 5
64 lines (54 loc) · 1.56 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
name: Docs
on:
push:
branches:
- main
pull_request:
concurrency:
group: docs
cancel-in-progress: false
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout Project
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Stable Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Cargo Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
- name: Clean docs folder
run: cargo clean --doc
- name: Build docs
run: cargo doc --no-deps --release
- name: Add redirect
run: |
echo '<meta http-equiv="refresh" content="0;url=/autopulse/index.html">' > target/doc/index.html
- name: Remove lock file
run: rm target/doc/.lock
- name: Publish to Cloudflare Pages
uses: dan-online/pages-action@main
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: autopulse
directory: target/doc
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
productionBranch: main
- name: Clean docs folder
run: cargo clean --doc