From 1fb462cd08f8072e349ea45ea087370131955fd5 Mon Sep 17 00:00:00 2001 From: Yaswant Pradhan <2984440+yaswant@users.noreply.github.com> Date: Wed, 18 Mar 2026 16:29:28 +0000 Subject: [PATCH] Use growss/sphinx-docs workflow to build-deploy docs --- .github/workflows/publish_wps.yaml | 73 +++++++----------------------- Makefile | 3 ++ 2 files changed, 19 insertions(+), 57 deletions(-) diff --git a/.github/workflows/publish_wps.yaml b/.github/workflows/publish_wps.yaml index c93b909e..8bbeed4d 100644 --- a/.github/workflows/publish_wps.yaml +++ b/.github/workflows/publish_wps.yaml @@ -14,62 +14,21 @@ on: types: [opened, reopened, synchronize] workflow_dispatch: -permissions: - contents: read - pages: write - id-token: write +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: - build-and-deploy: - runs-on: ubuntu-latest - timeout-minutes: 5 - env: - PYTHON_VRSN: '3.12' - VENV_PATH: '.venv' - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Setup uv with Python ${{ env.PYTHON_VRSN }} - uses: astral-sh/setup-uv@v7 - with: - python-version: ${{ env.PYTHON_VRSN }} - - - name: Cache uv venv - uses: actions/cache@v4 - with: - path: ${{ env.VENV_PATH }} - key: ${{ runner.os }}-uv-${{ env.PYTHON_VRSN }}-${{ hashFiles('pyproject.toml') }} - restore-keys: | - ${{ runner.os }}-uv-${{ env.PYTHON_VRSN }}- - - - name: Install dependencies - run: uv sync - - - name: Lint Sphinx docs - run: uv run sphinx-lint source - - - name: Build HTML docs - run: uv run make clean html - - - name: Minimize uv cache - run: uv cache prune --ci - - # -- Deploy to GitHub Pages only on push to upstream main - - name: Setup GitHub Pages - if: ${{ github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'merge_group') }} - uses: actions/configure-pages@v5 - - - name: Upload artifact to GitHub Pages - if: ${{ github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'merge_group') }} - uses: actions/upload-pages-artifact@v4 - with: - name: github-pages - path: build/html - retention-days: 1 - - - name: Deploy to GitHub Pages - id: deployment - if: ${{ github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'merge_group') }} - uses: actions/deploy-pages@v4 + docs: + uses: MetOffice/growss/.github/workflows/sphinx-docs.yaml@develop + with: + python-version: "3.12.9" + timeout-minutes: 10 + docs-dir: . + source-dir: ./source + use-pyproject: true + + permissions: + contents: read + pages: write + id-token: write diff --git a/Makefile b/Makefile index 5298fb1e..24edb284 100644 --- a/Makefile +++ b/Makefile @@ -26,3 +26,6 @@ help: deploy: @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(DEPLOYDIR)/$(REPO)/$(BRANCH)" $(SPHINXOPTS) $(O) + +lint: + sphinx-lint --d "horizontal-tab" --max-line-length 80 "$(SOURCEDIR)"