-
Notifications
You must be signed in to change notification settings - Fork 15
75 lines (61 loc) · 2.17 KB
/
publish_wps.yaml
File metadata and controls
75 lines (61 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# ------------------------------------------------------------------------------
# (c) Crown copyright Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
# ------------------------------------------------------------------------------
name: Docs
on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
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