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
|
2022-02-11 06:05:19 -08:00
|
|
|
paths:
|
2022-03-02 06:23:05 -08:00
|
|
|
# doc source files
|
2022-01-25 03:58:11 -08:00
|
|
|
- 'book/**'
|
|
|
|
- '**/firebase.json'
|
|
|
|
- 'katex-header.html'
|
2022-03-02 06:23:05 -08:00
|
|
|
# rustdoc source files
|
|
|
|
- '**/*.rs'
|
|
|
|
- '**/Cargo.toml'
|
|
|
|
- '**/Cargo.lock'
|
|
|
|
# workflow definitions
|
2022-01-25 03:58:11 -08:00
|
|
|
- '.github/workflows/docs.yml'
|
2021-02-20 03:31:12 -08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build and Deploy Docs (+beta)
|
2022-04-28 15:01:23 -07:00
|
|
|
timeout-minutes: 45
|
2021-02-20 03:31:12 -08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-04-11 22:06:37 -07:00
|
|
|
- name: Checkout the source code
|
2022-04-21 20:00:02 -07:00
|
|
|
uses: actions/checkout@v3.0.2
|
2022-04-11 22:06:37 -07:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2021-06-13 14:30:21 -07:00
|
|
|
|
2022-04-11 22:06:37 -07:00
|
|
|
- name: Install latest beta
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: beta
|
|
|
|
components: rust-docs
|
|
|
|
override: true
|
2021-02-20 03:31:12 -08:00
|
|
|
|
2022-04-11 22:06:37 -07:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2022-04-11 22:06:37 -07:00
|
|
|
- name: Install mdbook
|
|
|
|
run: |
|
|
|
|
cargo install mdbook
|
2022-05-09 13:29:49 -07:00
|
|
|
cargo install mdbook-mermaid
|
2021-06-13 14:30:21 -07:00
|
|
|
|
2022-04-11 22:06:37 -07:00
|
|
|
- name: Build Zebra book
|
|
|
|
run: |
|
|
|
|
mdbook build book/
|
2021-06-13 14:30:21 -07:00
|
|
|
|
2022-04-11 22:06:37 -07:00
|
|
|
- name: Deploy Zebra book to firebase
|
2022-06-10 12:46:19 -07:00
|
|
|
uses: w9jds/firebase-action@v2.2.0
|
2022-04-11 22:06:37 -07:00
|
|
|
with:
|
|
|
|
args: deploy
|
|
|
|
env:
|
|
|
|
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
|
|
|
|
PROJECT_PATH: book/
|
|
|
|
PROJECT_ID: zebra-book-b535f
|
2021-02-20 03:31:12 -08:00
|
|
|
|
2022-04-11 22:06:37 -07:00
|
|
|
- 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'
|
2021-02-20 03:31:12 -08:00
|
|
|
|
2022-04-11 22:06:37 -07:00
|
|
|
- name: Deploy external docs to firebase
|
2022-06-10 12:46:19 -07:00
|
|
|
uses: w9jds/firebase-action@v2.2.0
|
2022-04-11 22:06:37 -07:00
|
|
|
with:
|
|
|
|
args: deploy
|
|
|
|
env:
|
|
|
|
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
|
|
|
|
PROJECT_ID: zebra-doc-external
|
2021-02-20 03:31:12 -08:00
|
|
|
|
2022-04-11 22:06:37 -07:00
|
|
|
- name: Build internal docs
|
|
|
|
run: |
|
|
|
|
cargo doc --no-deps --document-private-items
|
|
|
|
env:
|
|
|
|
RUSTDOCFLAGS: '--html-in-header katex-header.html'
|
2021-02-20 03:31:12 -08:00
|
|
|
|
2022-04-11 22:06:37 -07:00
|
|
|
- name: Deploy internal docs to firebase
|
2022-06-10 12:46:19 -07:00
|
|
|
uses: w9jds/firebase-action@v2.2.0
|
2022-04-11 22:06:37 -07:00
|
|
|
with:
|
|
|
|
args: deploy
|
|
|
|
env:
|
|
|
|
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
|
|
|
|
PROJECT_ID: zebra-doc-internal-e9fd4
|