-
Notifications
You must be signed in to change notification settings - Fork 12
41 lines (34 loc) · 1.07 KB
/
rust.yml
File metadata and controls
41 lines (34 loc) · 1.07 KB
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
name: Docs
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: generate documentation
run: cargo doc --no-deps
- name: generate book
run: |
cargo install mdbook
cd book/text
mdbook build
- name: prep deployment branch
if: github.ref == 'refs/heads/main'
run: |
mkdir -p dist
cp -r target/doc/* dist/
cp -r book/text/book dist/
cd dist
git init
git add -A
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m 'deploy'
- name: push deployment branch
uses: ad-m/github-push-action@4cc74773234f74829a8c21bc4d69dd4be9cfa599 # v1.1.0
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
directory: ./dist