name: Docs on: workflow_dispatch: push: branches: - main paths: # doc source files - 'book/**' - '**/firebase.json' - 'katex-header.html' # rustdoc source files - '**/*.rs' - '**/Cargo.toml' - '**/Cargo.lock' # workflow definitions - '.github/workflows/docs.yml' jobs: build: name: Build and Deploy Docs (+beta) timeout-minutes: 45 runs-on: ubuntu-latest steps: - name: Checkout the source code uses: actions/checkout@v3.0.2 with: persist-credentials: false - name: Install latest beta uses: actions-rs/toolchain@v1 with: toolchain: beta components: rust-docs override: true - uses: Swatinem/rust-cache@v1 - name: Setup mdBook uses: peaceiris/actions-mdbook@v1.1.14 with: mdbook-version: '0.4.18' # TODO: actions-mdbook does not yet have an option to install mdbook-mermaid https://github.com/peaceiris/actions-mdbook/issues/426 - name: Install mdbook run: | cargo install mdbook-mermaid - name: Build Zebra book run: | mdbook build book/ - name: Deploy Zebra book to firebase uses: w9jds/firebase-action@v2.2.2 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.2.2 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.2.2 with: args: deploy env: FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} PROJECT_ID: zebra-doc-internal-e9fd4