Skip to content

Commit b3dc446

Browse files
authored
Merge pull request #5 from scientificcomputing/dokken/restructure
Restructure repos
2 parents dc8424d + 37f59cd commit b3dc446

File tree

8 files changed

+58
-29
lines changed

8 files changed

+58
-29
lines changed

.github/workflows/build_docs.yml

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,31 @@ name: Github Pages
33
on:
44
push:
55
branches:
6-
- main
6+
- "**"
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
21+
722
jobs:
8-
deploy:
23+
build:
924
runs-on: ubuntu-22.04
1025
container:
1126
image: finsberg/fenics-gmsh:latest
27+
1228
env:
1329
# Directory that will be published on github pages
14-
PUBLISH_DIR: ./docs/_build/html
30+
PUBLISH_DIR: ./_build/html
1531

1632
steps:
1733
- uses: actions/checkout@v3
@@ -20,13 +36,30 @@ jobs:
2036
run: python3 -m pip install -r requirements.txt
2137

2238
- name: Build docs
23-
run: jupyter book build docs
24-
25-
- name: Copy Dockerfile into gh-pages
26-
run: cp Dockerfile ${PUBLISH_DIR}/
39+
run: jupyter book build .
2740

28-
- name: Deploy
29-
uses: peaceiris/actions-gh-pages@v3
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v1
3043
with:
31-
github_token: ${{ secrets.GITHUB_TOKEN }}
32-
publish_dir: ${{ env.PUBLISH_DIR }}
44+
path: ${{ env.PUBLISH_DIR }}
45+
46+
47+
# Single deploy job since we're just deploying
48+
deploy:
49+
if: github.ref == 'refs/heads/main'
50+
needs: build
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Checkout
58+
uses: actions/checkout@v3
59+
60+
- name: Setup Pages
61+
uses: actions/configure-pages@v2
62+
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v1

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ instance/
8181
.scrapy
8282

8383
# Sphinx documentation
84-
docs/_build/
84+
_build/
8585

8686
# PyBuilder
8787
.pybuilder/

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use github pages for docker image
2-
FROM ghcr.io/scientificcomputing/example-paper-fenics:latest
2+
FROM ghcr.io/scientificcomputing/example-paper-fenics:v0.1.5
33

44
# Create user with a home directory
55
ARG NB_USER
@@ -17,6 +17,4 @@ RUN chown -R ${NB_UID} ${HOME}
1717

1818
USER ${NB_USER}
1919

20-
ENV PYTHONPATH /repo/example-paper-fenics/code:${PYTHONPATH}
21-
2220
ENTRYPOINT []

docs/_config.yml renamed to _config.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
title: Example FEniCS paper
55
author: Henrik Finsberg
6-
logo: "logo.png"
6+
logo: "docs/logo.png"
77
copyright: "2022"
88

99
# Force re-execution of notebooks on each build.
@@ -14,9 +14,7 @@ execute:
1414
# Information about where the book exists on the web
1515
repository:
1616
url: https://github.com/scientificcomputing/example-paper-fenics # Online location of your book
17-
path_to_book: _sources # Optional path to your book, relative to the repository root
18-
branch: gh-pages # Which branch of the repository should be used when creating links (optional)
19-
17+
2018
launch_buttons:
2119
notebook_interface: "jupyterlab" # The interface interactive links will activate ["classic", "jupyterlab"]
2220
binderhub_url: "https://mybinder.org"
@@ -34,7 +32,7 @@ parse:
3432

3533
sphinx:
3634
config:
37-
bibtex_bibfiles: ["refs.bib"]
35+
bibtex_bibfiles: ["docs/refs.bib"]
3836
suppress_warnings: ["bibtex.duplicate_citation"] # If the same paper is cited in multiple files
3937

4038
extra_extensions:

_toc.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
format: jb-book
2+
root: index
3+
4+
chapters:
5+
- file: docs/abstract
6+
- file: docs/reproducing
7+
- file: docs/docker
8+
- file: code/demo
9+
- file: docs/citation
File renamed without changes.

docs/_toc.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)