update --help
#127
Workflow file for this run
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: Docs | |
on: [push, workflow_dispatch] | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
jobs: | |
cache-deps: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup update --no-self-update | |
- name: Cache .cargo locked resources | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo | |
key: ${{ runner.os }}-docs-cargo-${{ hashFiles('Cargo.lock') }} | |
- run: cargo fetch | |
build-mdbook: | |
runs-on: ubuntu-latest | |
needs: [cache-deps] | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache .cargo locked resources | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/.cargo | |
key: ${{ runner.os }}-docs-cargo-${{ hashFiles('Cargo.lock') }} | |
- name: Install mdbook | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: mdbook,cargo-binstall | |
- name: Install mdbook plugins | |
run: cargo binstall -y mdbook-alerts | |
- name: Build book | |
run: mdbook build docs | |
- name: Upload docs build as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cpp-linter-docs | |
path: docs/book/html | |
- name: Upload to github pages | |
# only publish doc changes from main branch | |
if: github.ref == 'refs/heads/main' | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/book/html | |
build-rustdoc: | |
runs-on: ubuntu-latest | |
needs: [cache-deps] | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup update --no-self-update | |
- name: Cache .cargo locked resources | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/.cargo | |
key: ${{ runner.os }}-docs-cargo-${{ hashFiles('Cargo.lock') }} | |
- run: cargo doc --no-deps --manifest-path cpp-linter-lib/Cargo.toml | |
- name: upload rustdoc build as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: target/doc | |
name: cpp-linter-lib_docs |