Skip to content

Commit ae0fd21

Browse files
authored
Update workflows (#13)
* Update workflows * Use requirements
1 parent c82545f commit ae0fd21

File tree

5 files changed

+106
-128
lines changed

5 files changed

+106
-128
lines changed

.github/workflows/build_docs.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build documentation
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
workflow_call:
7+
workflow_dispatch:
8+
9+
10+
jobs:
11+
12+
build:
13+
runs-on: ubuntu-22.04
14+
env:
15+
PUBLISH_DIR: ./_build/html
16+
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v5
21+
22+
- name: Setup Python
23+
uses: actions/setup-python@v6
24+
with:
25+
python-version: "3.10"
26+
27+
- name: Install dependencies
28+
run: python3 -m pip install -r requirements.txt
29+
30+
- name: Build docs
31+
run: jupyter-book build -W --keep-going .
32+
33+
- name: Upload artifact
34+
uses: actions/upload-pages-artifact@v4
35+
with:
36+
path: ${{ env.PUBLISH_DIR }}

.github/workflows/build_pages.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

.github/workflows/deploy_docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: true
17+
18+
jobs:
19+
20+
build:
21+
uses: ./.github/workflows/build_docs.yml
22+
23+
deploy:
24+
needs: build
25+
environment:
26+
name: github-pages
27+
url: ${{ steps.deployment.outputs.page_url }}
28+
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v5
34+
35+
- name: Setup Pages
36+
uses: actions/configure-pages@v5
37+
38+
39+
- name: Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v4
Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,36 @@
1-
# Simple workflow for deploying static content to GitHub Pages
2-
name: Build docs
1+
name: Build documentation
32

43
on:
5-
workflow_dispatch:
6-
workflow_call:
74
pull_request:
8-
branches:
9-
- main
5+
branches: [main]
6+
workflow_call:
7+
workflow_dispatch:
8+
109

1110
jobs:
12-
build_docs:
11+
12+
build:
1313
runs-on: ubuntu-22.04
1414
env:
15-
PYTHON_VERSION: "3.10"
1615
PUBLISH_DIR: ./_build/html
1716

17+
1818
steps:
19-
# checkout the repository
20-
- uses: actions/checkout@v4
19+
- name: Checkout
20+
uses: actions/checkout@v5
2121

22-
# setup Python
23-
- name: Install Python ${{ env.PYTHON_VERSION }}
24-
uses: actions/setup-python@v4
22+
- name: Setup Python
23+
uses: actions/setup-python@v6
2524
with:
26-
python-version: ${{ env.PYTHON_VERSION }}
25+
python-version: "3.10"
2726

28-
# preserve pip cache to speed up installation
29-
- name: Cache
30-
id: cache
31-
uses: actions/cache@v3
32-
with:
33-
path: |
34-
~/.cache/pip
35-
~/_build
36-
key: cache_v1
37-
restore-keys: |
38-
cache_v1
39-
40-
- name: Install Python dependencies
41-
run: |
42-
python3 -m pip install --upgrade pip
43-
python3 -m pip install ".[docs]"
27+
- name: Install dependencies
28+
run: python3 -m pip install ".[docs]"
4429

4530
- name: Build docs
46-
run: python3 -m jupyter book build .
31+
run: jupyter-book build -W --keep-going .
4732

4833
- name: Upload artifact
49-
uses: actions/upload-artifact@v3
34+
uses: actions/upload-pages-artifact@v4
5035
with:
51-
name: documentation
5236
path: ${{ env.PUBLISH_DIR }}
Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,41 @@
1-
name: Github Pages
1+
name: Publish documentation
22

33
on:
44
push:
5-
branches: [main] # Only run on push to main
5+
branches: [main]
6+
workflow_dispatch:
7+
68

7-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
89
permissions:
910
contents: read
1011
pages: write
1112
id-token: write
1213

13-
# Allow one concurrent deployment
1414
concurrency:
1515
group: "pages"
1616
cancel-in-progress: true
1717

1818
jobs:
19-
build-docs:
19+
20+
build:
2021
uses: ./.github/workflows/build_docs.yml
2122

2223
deploy:
23-
needs: [build-docs]
24-
24+
needs: build
2525
environment:
2626
name: github-pages
2727
url: ${{ steps.deployment.outputs.page_url }}
2828

2929
runs-on: ubuntu-latest
30-
steps:
31-
- name: Download docs artifact
32-
# docs artifact is uploaded by build-docs job
33-
uses: actions/download-artifact@v3
34-
with:
35-
name: documentation
36-
path: "./public"
37-
38-
- name: Upload artifact
39-
uses: actions/upload-pages-artifact@v2
40-
with:
41-
path: "./public"
4230

31+
steps:
4332
- name: Checkout
44-
uses: actions/checkout@v4
33+
uses: actions/checkout@v5
4534

4635
- name: Setup Pages
47-
uses: actions/configure-pages@v3
36+
uses: actions/configure-pages@v5
37+
4838

4939
- name: Deploy to GitHub Pages
5040
id: deployment
51-
uses: actions/deploy-pages@v2
41+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)