-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.05 KB
/
gh-pages.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
name: gh-pages
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
docs-build-test-deploy:
name: Build, test and deploy docs
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Setup mdBook
uses: taiki-e/install-action@v2
with:
tool: mdbook
- run: mdbook build docs && mdbook test docs
- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: book
path: docs/book
- name: deploy-docs
if: ${{ github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book