Remove old branding. #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy mdBook docs to Pages | |
| # Builds the full multi-locale mdBook + rustdoc API reference and publishes | |
| # to a `gh-pages` branch. Configure Pages in repo Settings → Pages to serve | |
| # from the `gh-pages` branch root. | |
| # | |
| # All locales in locales.toml are built. Translations are produced locally | |
| # (see docs/book/src/maintainers/docs-and-translations.md) and committed to | |
| # the repo — this workflow does not call any translation provider. | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - "docs/book/**" | |
| - "src/**" | |
| - "crates/**" | |
| - "xtask/**" | |
| - "locales.toml" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| - ".github/workflows/docs-deploy.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: gh-pages | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| # MDBOOK_BIN_VERSION is scoped to this step only. Workflow-level | |
| # `MDBOOK_*` env vars leak into `cargo mdbook build` below — mdbook 0.5.0 | |
| # rejects unknown `MDBOOK_*` env vars as invalid config keys (#2942). | |
| - name: Install mdBook (aarch64 musl, ~3 MB) | |
| env: | |
| # Pinned to match the mdbook-mermaid 0.17.0 compile target — avoids | |
| # "preprocessor was built against 0.5.0, called from 0.5.2" warning. | |
| # Revisit when mdbook-mermaid ships against the latest mdbook minor. | |
| MDBOOK_BIN_VERSION: v0.5.0 | |
| run: | | |
| curl -sSL "https://github.com/rust-lang/mdBook/releases/download/${MDBOOK_BIN_VERSION}/mdbook-${MDBOOK_BIN_VERSION}-aarch64-unknown-linux-musl.tar.gz" \ | |
| | tar -xz -C /usr/local/bin | |
| - name: Install Rust stable toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust build cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: docs-deploy | |
| cache-all-crates: true | |
| - name: Install gettext tools | |
| run: sudo apt-get install -y --no-install-recommends gettext | |
| - name: Validate .po format | |
| run: | | |
| ok=0 | |
| for po in docs/book/po/*.po; do | |
| [ -f "$po" ] || continue | |
| msgfmt --check-format "$po" -o /dev/null || ok=1 | |
| done | |
| exit $ok | |
| # `cargo mdbook build` is an xtask alias (see .cargo/config.toml) that: | |
| # - ensure_cargo_tool installs mdbook-i18n-helpers and mdbook-mermaid | |
| # - Generates docs/book/src/reference/cli.md + config.md from live code | |
| # - Builds rustdoc across the workspace | |
| # - Builds mdBook for every locale in locales.toml into book/<locale>/ | |
| # - Assembles the final artifact (copies rustdoc to book/api, writes | |
| # root index.html that redirects to /en/) | |
| - name: Build docs (refs + rustdoc + all locales) | |
| run: cargo mdbook build | |
| - name: Deploy to gh-pages branch | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: docs/book/book | |
| publish_branch: gh-pages | |
| force_orphan: true | |
| cname: docs.zeroclawlabs.ai | |
| commit_message: "deploy: ${{ github.event.head_commit.message }}" |