Skip to content

Commit c087a4e

Browse files
committed
Setting up Docker image and Jupyter book build and deploy on GitHub
1 parent 80d8553 commit c087a4e

8 files changed

Lines changed: 75 additions & 7 deletions

File tree

.binder/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
### ###
77
################################################################################
88

9-
FROM registry.gitlab.inria.fr/mgenet/dolfin_warp-tutorials:latest
9+
# FROM registry.gitlab.inria.fr/mgenet/dolfin_warp-tutorials:latest
10+
FROM ghcr.io/mgenet/dolfin_warp-tutorials:latest
1011

1112
# Copy repo into the image, cf. https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html. MG20230531: OMG this copies from the "build context", cf. https://stackoverflow.com/questions/73156067/where-does-the-copy-command-in-docker-copy-from; here it seems to be the repo itself.
1213
ARG NB_USER=jovyan
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on:
2+
- push
3+
4+
jobs:
5+
build_and_deploy_jupyter_book:
6+
runs-on: ubuntu-latest
7+
8+
permissions:
9+
pages: write
10+
11+
environment:
12+
name: github-pages
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Build Jupyter Book
19+
run: |
20+
pip install -U jupyter-book
21+
jupyter-book clean .
22+
jupyter-book build .
23+
24+
- name: Upload artifact
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: github-pages
28+
path: "_build/html"
29+
30+
- name: Deploy Jupyter Book to GitHub Pages
31+
uses: actions/deploy-pages@v4
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on:
2+
- push
3+
4+
jobs:
5+
build_and_push_docker_image:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout code
9+
uses: actions/checkout@main
10+
11+
- name: Removing Docker file
12+
run: |
13+
rm -rf ${{github.workspace}}/.binder
14+
cp ${{github.workspace}}/.repo2docker/* ${{github.workspace}}/.
15+
16+
- name: Build and push docker image
17+
uses: jupyterhub/repo2docker-action@master
18+
with:
19+
DOCKER_USERNAME: ${{github.actor}}
20+
DOCKER_PASSWORD: ${{secrets.GITHUB_TOKEN}}
21+
DOCKER_REGISTRY: ghcr.io
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on:
2+
- push
3+
- delete
4+
5+
jobs:
6+
sync:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
fetch-depth: 0
12+
- uses: wangchucheng/git-repo-sync@v0.1.0
13+
with:
14+
target-url: https://gitlab.inria.fr/mgenet/dolfin_warp-tutorials
15+
target-username: mgenet
16+
target-token: ${{secrets.GITLAB_TOKEN}}

.gitlab-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ build_docker:
1515
tags:
1616
- ci.inria.fr
1717
- large
18-
# image: registry.gitlab.inria.fr/inria-ci/docker/ubuntu:20.04
1918
image: ubuntu:20.04
2019
script:
2120
- apt update; DEBIAN_FRONTEND=noninteractive apt install -y ca-certificates curl git gnupg lsb-release mercurial python3 python3-pip tzdata

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Welcome to the dolfin_warp tutorials!
22

3-
Main library can be found at https://gitlab.inria.fr/mgenet/dolfin_warp
3+
Main library can be found at https://github.com/mgenet/dolfin_warp
44

5-
Interactive tutorials can be found at https://mgenet.gitlabpages.inria.fr/dolfin_warp-tutorials/index.html.
5+
Interactive tutorials can be found at https://mgenet.github.io/dolfin_warp-tutorials.

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Welcome to the dolfin_warp tutorials!
22

3-
Main library can be found at [https://gitlab.inria.fr/mgenet/dolfin_warp](https://gitlab.inria.fr/mgenet/dolfin_warp).
3+
Main library can be found at [https://github.com/mgenet/dolfin_warp](https://github.com/mgenet/dolfin_warp).
44

55
Tutorials can be browsed statically but also interactively—to start a session and run the code just click on the rocket icon at the top of a tutorial page and then click on Binder.

tutos/tuto_warp.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"source": [
2525
"import dolfin # https://fenicsproject.org\n",
2626
"\n",
27-
"import dolfin_warp as dwarp # https://gitlab.inria.fr/mgenet/dolfin_warp\n",
27+
"import dolfin_warp as dwarp # https://github.com/mgenet/dolfin_warp\n",
2828
"\n",
2929
"import lib_viewer"
3030
]
@@ -488,7 +488,7 @@
488488
"name": "python",
489489
"nbconvert_exporter": "python",
490490
"pygments_lexer": "ipython3",
491-
"version": "3.8.15"
491+
"version": "3.10.14"
492492
},
493493
"toc": {
494494
"base_numbering": 1,

0 commit comments

Comments
 (0)