diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e13e85c..949d81d 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -47,8 +47,9 @@ just ci # ci-rust + nix flake check just docs # mdBook build ``` -The GitHub workflow jobs currently use `if: false`, so hosted checks are -skipped. Run the recipes locally and report that distinction in the PR. +GitHub workflows call the same recipes. The Docs workflow builds pull +requests and `main`, then uploads the book as a Pages artifact. Only pushes +and manual runs on `main` publish it through the `github-pages` environment. For dependency policy checks: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 934e0d8..230cf54 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,19 +5,28 @@ on: branches: [main] paths: - "docs/**" + - "CHANGELOG.md" + - "Justfile" + - ".github/actions/setup-nix/**" + - ".github/actions/setup-rust/**" - ".github/workflows/docs.yml" pull_request: paths: - "docs/**" + - "CHANGELOG.md" + - "Justfile" + - ".github/actions/setup-nix/**" + - ".github/actions/setup-rust/**" - ".github/workflows/docs.yml" workflow_dispatch: concurrency: group: pages-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read + pages: read jobs: build: @@ -30,6 +39,9 @@ jobs: with: persist-credentials: false + - name: Configure Pages + uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 + - name: Install Nix uses: ./.github/actions/setup-nix @@ -40,3 +52,27 @@ jobs: - name: Build book run: just docs + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 + with: + path: docs/book + + deploy: + name: Deploy book + needs: build + if: >- + github.ref == 'refs/heads/main' && + (github.event_name == 'push' || github.event_name == 'workflow_dispatch') + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to Pages + id: deployment + uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1 diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 0d7f6f2..6eed53c 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -40,7 +40,11 @@ jobs: install-cargo-audit: "false" - name: nix flake check + env: + NIX_CONFIG: "access-tokens = github.com=${{ github.token }}" run: just flake-check - name: nix flake check (eval-only, all systems) + env: + NIX_CONFIG: "access-tokens = github.com=${{ github.token }}" run: just flake-check-eval-all diff --git a/CHANGELOG.md b/CHANGELOG.md index e820825..fb4121a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -143,12 +143,17 @@ Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and helper tools use pinned versions. Nix installer temporary files work with GNU and macOS `mktemp`. Nix setup extends existing feature settings with `nix-command` and `flakes`. + Nix checks authenticate GitHub input fetches with their read-only job + token. Cargo tool installation honors `CARGO_INSTALL_ROOT` and `CARGO_HOME` and verifies the selected executables before adding their directory to `PATH`. - Runs formatting, Clippy, and Markdown lint from pre-commit hooks. Pre-push hooks run the Rust gate, dependency policy, and advisory checks. The Rust gate includes native, release, and Linux-target Clippy; the toolchain configuration includes `x86_64-unknown-linux-gnu`. +- Builds documentation on pull requests and publishes `main` through + GitHub Pages. Deployment uses official actions pinned to full commits + and a `main`-restricted `github-pages` environment. - Keeps Markdown lint rules in `.markdownlint-cli2.jsonc` and excludes generated Cargo and mdBook output. Dependency policy checks duplicate crate versions, sources, licenses, and advisories, with a documented