rdlfmt 0.2.0

A formatter for SystemRDL
Documentation
name: Docs

on:
  push:
    branches: [main]
  pull_request:

# A newer push to the same branch makes the in-flight run irrelevant.
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:
  # Runs on pull requests too, so a broken cross-reference is caught before it
  # is merged rather than at deploy time. `--fail-on-warning` is what makes
  # that check worth anything.
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: astral-sh/setup-uv@v10.0.1
        with:
          enable-cache: true
      - run: >
          uv run --project docs --locked
          sphinx-build -b html --fail-on-warning docs docs/_build/html
      - uses: actions/upload-pages-artifact@v5
        with:
          path: docs/_build/html

  deploy:
    needs: build
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    # A deployment in flight is left to finish; cancelling one is how Pages
    # ends up serving a half-written site.
    concurrency:
      group: pages
      cancel-in-progress: false
    permissions:
      pages: write
      id-token: write
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - id: deployment
        uses: actions/deploy-pages@v5