-
Notifications
You must be signed in to change notification settings - Fork 76
63 lines (54 loc) · 1.75 KB
/
netlify.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
name: Publish Cargo docs
on:
push:
branches:
- main
pull_request_target:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust
run: |
rustup update ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
- name: Build Docs
run: |
cargo doc --no-deps
# Add an index.html for the root of the netlify docs.
rustdoc README.md --output target/doc && mv target/doc/README.html target/doc/index.html
- if: github.ref == 'refs/heads/main'
name: Deploy to Netlify (main only)
uses: South-Paw/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
build-dir: target/doc/
comment-on-commit: true
- if: github.ref != 'refs/heads/main'
name: Deploy to Netlify (PR only)
id: deploy_docs
uses: netlify/actions/cli@6c34c3fcafc69ac2e1d6dbf226560329c6dfc51b
with:
args: deploy --dir=target/doc/ --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- if: github.ref != 'refs/heads/main'
name: Commenting on PR
uses: unsplash/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: |
Netlify deployed agent-rust as draft
Link: ${{ steps.deploy_docs.outputs.NETLIFY_URL }}