-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (32 loc) · 978 Bytes
/
documentation.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
name: Deploy documentation
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install mdbook
run: cargo install mdbook
- name: Build documentation
run: cargo doc --no-deps
- name: Deploy to GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git clone --branch gh-pages https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git gh-pages
rsync -av --delete target/doc/ gh-pages/
cd gh-pages
git add .
git commit -m "Update documentation"
git push origin gh-pages