# Docs-site split Phase 1 (docs/internal/specs/2026-07-03-docs-site-split.md):
# docs.roboco.tech (the roboco-website repo) is now the canonical user-facing
# docs site, so this workflow no longer builds MkDocs. It deploys the
# already-generated, already-committed `docs-redirects/` directory — one
# meta-refresh + rel=canonical stub per URL this repo's Pages site used to
# publish, pointing at the docs.roboco.tech equivalent — with GitHub's
# official Pages Actions flow (upload artifact -> deploy). No force-push
# race, and the custom domain set in Settings persists across deploys.
#
# `docs-redirects/` was generated once by scripts/gen_docs_redirects.py while
# mkdocs.yml still listed every published page; that script is not re-run
# here. Regenerating it (e.g. to add a redirect) means re-running the script
# against a restored copy of the old nav and committing the new output.
#
# One-time setup: Settings -> Pages -> Source = "GitHub Actions".
name: docs

on:
  push:
    branches: [master]
    paths:
      - "docs-redirects/**"
      - ".github/workflows/docs.yml"
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

# Allow one Pages deployment at a time; queue (don't cancel) overlapping runs.
concurrency:
  group: pages
  cancel-in-progress: false

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - name: Upload Pages artifact
        uses: actions/upload-pages-artifact@v5
        with:
          path: docs-redirects

  deploy:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v5
