Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 16 additions & 57 deletions .github/workflows/publish_wps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)"