aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/docs.yml
blob: 3f91dd97e978192f5fdc6f391cc7004e3febae6b (plain)
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
name: Build and Deploy Rust API Docs

on:
  push:
    branches:
      - master   

jobs:
   docs:
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - name: Checkout sources
        uses: actions/checkout@v2
        with:
          submodules: recursive

      - name: Get date for registry cache
        id: date
        run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

      - name: Cargo registry cache
        uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git
          key: ${{ runner.os }}-cargo-registry-${{ steps.date.outputs.date }}

      - name: Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true

      - name: Build Documentation
        uses: actions-rs/cargo@v1
        with:
          command: doc
          args: --no-deps --all --document-private-items

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./target/doc
          publish_branch: gh-pages 
          force_orphan: true