-
Notifications
You must be signed in to change notification settings - Fork 5
59 lines (56 loc) · 1.62 KB
/
docs.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
name: Documentation
on:
push:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
doc:
if: github.event_name == 'push' && (github.repository != 'ComPWA/strong2020-salamanca' || github.ref_name == 'main') || github.event_name == 'pull_request'
name: Execute and build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: pip install -e .[doc] tox
- name: Fetch Jupyter cache
uses: actions/cache@v3
with:
key: jupyter-cache-${{ hashFiles('docs/**.ipynb') }}
restore-keys: |
jupyter-cache-${{ hashFiles('docs/**.ipynb') }}
jupyter-cache
path: |
./docs/_build/.jupyter_cache
- name: Fetch downloaded data
uses: actions/cache@v3
with:
key: data-${{ hashFiles('docs/**.ipynb') }}
restore-keys: |
data-${{ hashFiles('docs/**.ipynb') }}
data
path: |
./docs/data
- run: tox -e docnb
- uses: actions/upload-pages-artifact@v2
if: always()
with:
path: ./docs/_build/html
gh-pages:
if: github.event_name == 'push' && (github.repository != 'ComPWA/strong2020-salamanca' || github.ref_name == 'main')
name: Upload to GitHub Pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs:
- doc
permissions:
pages: write
id-token: write
runs-on: ubuntu-22.04
steps:
- id: deployment
uses: actions/deploy-pages@v2