forked from Gibies/CSET
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (67 loc) · 2.3 KB
/
documentation.yml
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
76
77
78
name: Documentation
on:
push:
branches:
- "main"
workflow_dispatch:
# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Cache conda environment
id: conda-env-cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
with:
key: conda|${{runner.os}}-${{runner.arch}}|${{hashFiles('requirements/locks/py312-lock-linux-64.txt')}}
path: |
~/conda-env
~/.local/share/cartopy
- name: Create conda environment
if: steps.conda-env-cache.outputs.cache-hit != 'true'
run: |
# Check cache hasn't pulled a partial key match.
test ! -e "${HOME}/conda-env"
conda create --prefix="${HOME}/conda-env" --file=requirements/locks/py312-lock-linux-64.txt
- name: Add conda environment to PATH
run: echo "${HOME}/conda-env/bin" >> $GITHUB_PATH
- name: Build documentation
run: |
# Install module so it can be imported during docs generation.
echo '::group::Installing local package'
python3 -m pip install .
echo '::endgroup::'
# Generate the documentation
echo '::group::Building the documentation'
sphinx-build -b html --color "docs/source" "docs/build/html"
echo '::endgroup::'
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: html-docs
path: docs/build/html/
retention-days: 1
if-no-files-found: error
pages-deploy:
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build-docs
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: html-docs
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
with:
path: "."
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e