Skip to content

Commit a86cd8b

Browse files
Use growss/sphinx-docs workflow to build-deploy docs (#602)
Co-authored-by: Cameron Bateman <cameron.bateman@metoffice.gov.uk>
1 parent 5fe8fc7 commit a86cd8b

2 files changed

Lines changed: 19 additions & 57 deletions

File tree

.github/workflows/publish_wps.yaml

Lines changed: 16 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -14,62 +14,21 @@ on:
1414
types: [opened, reopened, synchronize]
1515
workflow_dispatch:
1616

17-
permissions:
18-
contents: read
19-
pages: write
20-
id-token: write
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
2120

2221
jobs:
23-
build-and-deploy:
24-
runs-on: ubuntu-latest
25-
timeout-minutes: 5
26-
env:
27-
PYTHON_VRSN: '3.12'
28-
VENV_PATH: '.venv'
29-
30-
steps:
31-
- name: Checkout repository
32-
uses: actions/checkout@v6
33-
34-
- name: Setup uv with Python ${{ env.PYTHON_VRSN }}
35-
uses: astral-sh/setup-uv@v7
36-
with:
37-
python-version: ${{ env.PYTHON_VRSN }}
38-
39-
- name: Cache uv venv
40-
uses: actions/cache@v4
41-
with:
42-
path: ${{ env.VENV_PATH }}
43-
key: ${{ runner.os }}-uv-${{ env.PYTHON_VRSN }}-${{ hashFiles('pyproject.toml') }}
44-
restore-keys: |
45-
${{ runner.os }}-uv-${{ env.PYTHON_VRSN }}-
46-
47-
- name: Install dependencies
48-
run: uv sync
49-
50-
- name: Lint Sphinx docs
51-
run: uv run sphinx-lint source
52-
53-
- name: Build HTML docs
54-
run: uv run make clean html
55-
56-
- name: Minimize uv cache
57-
run: uv cache prune --ci
58-
59-
# -- Deploy to GitHub Pages only on push to upstream main
60-
- name: Setup GitHub Pages
61-
if: ${{ github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'merge_group') }}
62-
uses: actions/configure-pages@v5
63-
64-
- name: Upload artifact to GitHub Pages
65-
if: ${{ github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'merge_group') }}
66-
uses: actions/upload-pages-artifact@v4
67-
with:
68-
name: github-pages
69-
path: build/html
70-
retention-days: 1
71-
72-
- name: Deploy to GitHub Pages
73-
id: deployment
74-
if: ${{ github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'merge_group') }}
75-
uses: actions/deploy-pages@v4
22+
docs:
23+
uses: MetOffice/growss/.github/workflows/sphinx-docs.yaml@develop
24+
with:
25+
python-version: "3.12.9"
26+
timeout-minutes: 10
27+
docs-dir: .
28+
source-dir: ./source
29+
use-pyproject: true
30+
31+
permissions:
32+
contents: read
33+
pages: write
34+
id-token: write

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ help:
2626

2727
deploy:
2828
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(DEPLOYDIR)/$(REPO)/$(BRANCH)" $(SPHINXOPTS) $(O)
29+
30+
lint:
31+
sphinx-lint --d "horizontal-tab" --max-line-length 80 "$(SOURCEDIR)"

0 commit comments

Comments
 (0)