2021-02-20 03:31:12 -08:00
|
|
|
name: Docs
|
|
|
|
|
|
|
|
on:
|
2021-03-03 13:59:01 -08:00
|
|
|
workflow_dispatch:
|
2021-02-20 03:31:12 -08:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build:
|
|
|
|
name: Build and Deploy Docs (+beta)
|
|
|
|
timeout-minutes: 30
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout the source code
|
2021-10-18 21:03:10 -07:00
|
|
|
uses: actions/checkout@v2.3.5
|
2021-05-16 16:32:38 -07:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2021-06-13 14:30:21 -07:00
|
|
|
|
2021-02-20 03:31:12 -08:00
|
|
|
- name: Install latest beta
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: beta
|
2021-04-29 13:49:32 -07:00
|
|
|
components: rust-docs
|
2021-02-20 03:31:12 -08:00
|
|
|
override: true
|
|
|
|
|
2021-06-14 18:36:33 -07:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
|
2021-02-20 03:31:12 -08:00
|
|
|
- name: Install mdbook
|
|
|
|
run: |
|
2021-06-13 14:30:21 -07:00
|
|
|
cargo install mdbook
|
|
|
|
|
2021-02-20 03:31:12 -08:00
|
|
|
- name: Build Zebra book
|
|
|
|
run: |
|
|
|
|
mdbook build book/
|
2021-06-13 14:30:21 -07:00
|
|
|
|
2021-02-20 03:31:12 -08:00
|
|
|
- name: Deploy Zebra book to firebase
|
|
|
|
uses: w9jds/firebase-action@v2.0.0
|
|
|
|
with:
|
|
|
|
args: deploy
|
|
|
|
env:
|
|
|
|
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
|
|
|
|
PROJECT_PATH: book/
|
|
|
|
PROJECT_ID: zebra-book-b535f
|
|
|
|
|
|
|
|
- name: Build external docs
|
|
|
|
run: |
|
|
|
|
# Exclude zebra-utils, it is not for library or app users
|
|
|
|
cargo doc --no-deps --workspace --exclude zebra-utils
|
|
|
|
env:
|
|
|
|
RUSTDOCFLAGS: "--html-in-header katex-header.html"
|
|
|
|
|
|
|
|
- name: Deploy external docs to firebase
|
|
|
|
uses: w9jds/firebase-action@v2.0.0
|
|
|
|
with:
|
|
|
|
args: deploy
|
|
|
|
env:
|
|
|
|
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
|
|
|
|
PROJECT_ID: zebra-doc-external
|
|
|
|
|
|
|
|
- name: Build internal docs
|
|
|
|
run: |
|
|
|
|
cargo doc --no-deps --document-private-items
|
|
|
|
env:
|
|
|
|
RUSTDOCFLAGS: "--html-in-header katex-header.html"
|
|
|
|
|
|
|
|
- name: Deploy internal docs to firebase
|
|
|
|
uses: w9jds/firebase-action@v2.0.0
|
|
|
|
with:
|
|
|
|
args: deploy
|
|
|
|
env:
|
|
|
|
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
|
|
|
|
PROJECT_ID: zebra-doc-internal-e9fd4
|