|
14 | 14 | types: [opened, reopened, synchronize] |
15 | 15 | workflow_dispatch: |
16 | 16 |
|
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 |
21 | 20 |
|
22 | 21 | 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 |
0 commit comments