Skip to content

Commit c8f2b3e

Browse files
authored
Merge pull request #13 from scientificcomputing/dokken/update-workflows
Try updating example paper workflows
2 parents 84cfe6a + e0328c3 commit c8f2b3e

File tree

8 files changed

+99
-73
lines changed

8 files changed

+99
-73
lines changed

.github/workflows/build_docs.yml

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
1-
name: Github Pages
1+
name: Build documentation
22

33
on:
44
push:
55
branches:
66
- "**"
7-
8-
# Allows you to run this workflow manually from the Actions tab
9-
workflow_dispatch:
10-
11-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12-
permissions:
13-
contents: read
14-
pages: write
15-
id-token: write
16-
17-
# Allow one concurrent deployment
18-
concurrency:
19-
group: "pages"
20-
cancel-in-progress: true
7+
workflow_call:
218

229
jobs:
2310
build:
2411
runs-on: ubuntu-22.04
2512
container:
26-
image: ghcr.io/scientificcomputing/fenics-gmsh:2023-08-16
13+
image: ghcr.io/scientificcomputing/fenics-gmsh:2024-02-19
2714

2815
env:
2916
# Directory that will be published on github pages
@@ -38,10 +25,9 @@ jobs:
3825
- name: Build docs
3926
run: jupyter book build -W .
4027

41-
4228
- name: Cache
4329
id: cache
44-
uses: actions/cache@v3
30+
uses: actions/cache@v4
4531
with:
4632
path: |
4733
~/.cache/pip
@@ -57,28 +43,7 @@ jobs:
5743
run: jupyter book build .
5844

5945
- name: Upload artifact
60-
uses: actions/upload-pages-artifact@v2
46+
uses: actions/upload-artifact@v4
6147
with:
6248
path: ${{ env.PUBLISH_DIR }}
63-
64-
# Single deploy job since we're just deploying
65-
deploy:
66-
if: github.ref == 'refs/heads/main'
67-
needs: build
68-
environment:
69-
name: github-pages
70-
url: ${{ steps.deployment.outputs.page_url }}
71-
72-
runs-on: ubuntu-latest
73-
74-
steps:
75-
- name: Checkout
76-
uses: actions/checkout@v4
77-
78-
- name: Setup Pages
79-
uses: actions/configure-pages@v3
80-
81-
82-
- name: Deploy to GitHub Pages
83-
id: deployment
84-
uses: actions/deploy-pages@v2
49+
name: documentation

.github/workflows/deploy_pages.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy pages
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow one concurrent deployment
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build-docs:
23+
uses: ./.github/workflows/build_docs.yml
24+
25+
build:
26+
runs-on: ubuntu-22.04
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
31+
steps:
32+
- name: Download docs artifact
33+
# docs artifact is uploaded by build-docs job
34+
uses: actions/download-artifact@v4
35+
with:
36+
name: documentation
37+
path: "./public"
38+
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: "./public"
43+
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v3
46+
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

.github/workflows/docker-image.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
name: Create and publish a Docker image
77

88
on:
9+
pull_request:
10+
branches: ["main"]
911
push:
10-
branches:
11-
- "!*"
1212
tags:
1313
- "v*"
1414

@@ -25,29 +25,41 @@ jobs:
2525

2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929

3030
- name: Set up QEMU
31-
uses: docker/setup-qemu-action@v2
31+
uses: docker/setup-qemu-action@v3
3232

3333
- name: Set up Docker Buildx
34-
uses: docker/setup-buildx-action@v2
34+
uses: docker/setup-buildx-action@v3
3535

3636
- name: Log in to the Container registry
37-
uses: docker/login-action@v2
37+
uses: docker/login-action@v3
3838
with:
3939
registry: ${{ env.REGISTRY }}
4040
username: ${{ github.actor }}
4141
password: ${{ secrets.GITHUB_TOKEN }}
4242

4343
- name: Extract metadata (tags, labels) for Docker
4444
id: meta
45-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
45+
uses: docker/metadata-action@v5
4646
with:
4747
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4848

49-
- name: Build and push Docker image
50-
uses: docker/build-push-action@v3
49+
- name: Build local docker image
50+
uses: docker/build-push-action@v5
51+
with:
52+
context: .
53+
push: false
54+
load: true
55+
platforms: linux/amd64
56+
tags: ${{ steps.meta.outputs.tags }}
57+
labels: ${{ steps.meta.outputs.labels }}
58+
file: docker/Dockerfile
59+
60+
- name: Build and push Docker image (on tagged version)
61+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
62+
uses: docker/build-push-action@v5
5163
with:
5264
context: .
5365
push: true

.github/workflows/reproduce_results.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ on:
66
branches: ["main"]
77
pull_request:
88
branches: ["main"]
9-
9+
schedule:
10+
- cron: "30 9 * * 1"
1011
# Allows you to run this workflow manually from the Actions tab
1112
workflow_dispatch:
1213
workflow_call:
1314

14-
1515
jobs:
1616
run:
1717
runs-on: ubuntu-22.04
1818
container:
19-
image: ghcr.io/scientificcomputing/fenics-gmsh:2023-08-16
19+
image: ghcr.io/scientificcomputing/fenics-gmsh:2024-02-19
2020

2121
steps:
2222
- uses: actions/checkout@v4
2323

2424
- name: Cache
2525
id: cache
26-
uses: actions/cache@v3
26+
uses: actions/cache@v4
2727
with:
2828
path: |
2929
~/.cache/pip
@@ -48,7 +48,7 @@ jobs:
4848

4949
- name: Upload artifact
5050
if: always()
51-
uses: actions/upload-artifact@v3
51+
uses: actions/upload-artifact@v4
5252
with:
5353
path: |
5454
./data/mesh

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/scientificcomputing/fenics-gmsh:2023-08-16
1+
FROM ghcr.io/scientificcomputing/fenics-gmsh:2024-02-19
22

33
ARG REPO_BRANCH="main"
44

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "my-fenics-paper"
7-
version = "0.3.0"
7+
version = "0.4.0"
88
dependencies = [
9-
"h5py==3.9.0", # Pin to same version that is allready installed in the docker image
9+
"h5py==3.10.0", # Same as in docker image to avoid compilation issues with HDF5
1010
"cardiac-geometries>=0.11.0",
1111
"ldrb",
1212
"requests",

requirements-docs.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ babel==2.13.1
2222
beautifulsoup4==4.12.2
2323
# via pydata-sphinx-theme
2424
cardiac-geometries==0.11.0
25-
# via my-paper (pyproject.toml)
25+
# via my-fenics-paper (pyproject.toml)
2626
certifi==2023.7.22
2727
# via requests
2828
charset-normalizer==3.3.2
@@ -56,10 +56,10 @@ fastjsonschema==2.18.1
5656
# via nbformat
5757
greenlet==3.0.1
5858
# via sqlalchemy
59-
h5py==3.9.0
59+
h5py==3.10.0
6060
# via
6161
# ldrb
62-
# my-paper (pyproject.toml)
62+
# my-fenics-paper (pyproject.toml)
6363
idna==3.4
6464
# via requests
6565
imagesize==1.4.1
@@ -88,7 +88,7 @@ jsonschema==4.19.2
8888
jsonschema-specifications==2023.7.1
8989
# via jsonschema
9090
jupyter-book==0.15.1
91-
# via my-paper (pyproject.toml)
91+
# via my-fenics-paper (pyproject.toml)
9292
jupyter-cache==0.6.1
9393
# via myst-nb
9494
jupyter-client==8.6.0
@@ -102,11 +102,11 @@ jupyter-core==5.5.0
102102
# nbclient
103103
# nbformat
104104
jupytext==1.15.2
105-
# via my-paper (pyproject.toml)
105+
# via my-fenics-paper (pyproject.toml)
106106
latexcodec==2.0.1
107107
# via pybtex
108108
ldrb==2023.4.0
109-
# via my-paper (pyproject.toml)
109+
# via my-fenics-paper (pyproject.toml)
110110
linkify-it-py==2.0.2
111111
# via jupyter-book
112112
llvmlite==0.40.1
@@ -211,7 +211,7 @@ referencing==0.30.2
211211
# jsonschema-specifications
212212
requests==2.31.0
213213
# via
214-
# my-paper (pyproject.toml)
214+
# my-fenics-paper (pyproject.toml)
215215
# sphinx
216216
rich==13.6.0
217217
# via
@@ -277,7 +277,7 @@ sphinxcontrib-applehelp==1.0.7
277277
sphinxcontrib-bibtex==2.5.0
278278
# via
279279
# jupyter-book
280-
# my-paper (pyproject.toml)
280+
# my-fenics-paper (pyproject.toml)
281281
sphinxcontrib-devhelp==1.0.5
282282
# via sphinx
283283
sphinxcontrib-htmlhelp==2.0.4
@@ -301,7 +301,7 @@ tornado==6.3.3
301301
# ipykernel
302302
# jupyter-client
303303
tqdm==4.66.1
304-
# via my-paper (pyproject.toml)
304+
# via my-fenics-paper (pyproject.toml)
305305
traitlets==5.13.0
306306
# via
307307
# comm

requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# pip-compile --output-file=requirements.txt pyproject.toml
66
#
77
cardiac-geometries==0.11.0
8-
# via my-paper (pyproject.toml)
8+
# via my-fenics-paper (pyproject.toml)
99
certifi==2023.7.22
1010
# via requests
1111
charset-normalizer==3.3.2
@@ -14,14 +14,14 @@ click==8.1.3
1414
# via rich-click
1515
commonmark==0.9.1
1616
# via rich
17-
h5py==3.9.0
17+
h5py==3.10.0
1818
# via
1919
# ldrb
20-
# my-paper (pyproject.toml)
20+
# my-fenics-paper (pyproject.toml)
2121
idna==3.4
2222
# via requests
2323
ldrb==2023.4.0
24-
# via my-paper (pyproject.toml)
24+
# via my-fenics-paper (pyproject.toml)
2525
llvmlite==0.40.1
2626
# via numba
2727
meshio==5.3.4
@@ -38,14 +38,14 @@ numpy==1.21.6
3838
pygments==2.13.0
3939
# via rich
4040
requests==2.31.0
41-
# via my-paper (pyproject.toml)
41+
# via my-fenics-paper (pyproject.toml)
4242
rich==12.6.0
4343
# via
4444
# meshio
4545
# rich-click
4646
rich-click==1.5.2
4747
# via cardiac-geometries
4848
tqdm==4.66.1
49-
# via my-paper (pyproject.toml)
49+
# via my-fenics-paper (pyproject.toml)
5050
urllib3==2.0.7
5151
# via requests

0 commit comments

Comments
 (0)