git-bot-feedback 0.7.0

A library designed for CI tools that posts comments on a Pull Request.
Documentation
name: Docs build

on:
  push:
    branches: [main]
    paths:
      - docs/**/*
      - nurfile
      - uv.lock
      - src/**/*.rs
      - bindings/python/**/*
      - .github/workflows/docs.yml
  pull_request:
    branches: [main]
    paths:
      - docs/**/*
      - nurfile
      - uv.lock
      - src/**/*.rs
      - bindings/python/**/*
      - .github/workflows/docs.yml

permissions: {}

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }}

jobs:
  py-docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false
      - uses: actions/setup-python@v6.2.0
        with:
          python-version: 3.x
      - name: Setup Rust
        run: rustup update --no-self-update
      - uses: cargo-bins/cargo-binstall@732870f031d2fb36309d0deaf36abcc704a7be65 # v1.20.1
      - name: Install nur
        env:
          GITHUB_TOKEN: ${{ github.token }}
        run: cargo binstall -y nur
      - name: Install uv
        uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
      - name: Cache rust deps
        uses: actions/cache@v5.0.5
        with:
          path: |
            ~/.cargo/registry/index/
            ~/.cargo/registry/cache/
            ~/.cargo/git/db/
          key: cargo-pyo3-docs-${{ hashFiles('src/**', 'bindings/python/src/**', 'Cargo.lock') }}
      - name: Build docs
        run: nur docs py
      - name: Upload docs
        uses: actions/upload-pages-artifact@v5
        with:
          path: docs/_build/html

  deploy-docs:
    name: Deploy docs
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    needs: [py-docs]
    environment:
      name: github-pages
      url: ${{ steps.deploy-pages.outputs.page_url }}
    permissions:
      pages: write # to deploy to Pages
      id-token: write # to verify the deployment originates from an appropriate source
    steps:
      - name: Deploy to GitHub Pages
        uses: actions/deploy-pages@v5
        id: deploy-pages

  rs-docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false
      - name: Setup Rust
        run: rustup update --no-self-update
      - uses: cargo-bins/cargo-binstall@732870f031d2fb36309d0deaf36abcc704a7be65 # v1.20.1
      - name: Install nur
        env:
          GITHUB_TOKEN: ${{ github.token }}
        run: cargo binstall -y nur
      - name: Cache rust deps
        uses: actions/cache@v5.0.5
        with:
          path: |
            ~/.cargo/registry/index/
            ~/.cargo/registry/cache/
            ~/.cargo/git/db/
          key: cargo-rs-docs-${{ hashFiles('src/**', 'Cargo.lock') }}
      - name: Build docs
        run: nur docs
      - name: Upload docs
        uses: actions/upload-artifact@v7
        with:
          path: target/doc/git_bot_feedback
          name: rust-docs