Skip to content

Commit eb9eaff

Browse files
authored
Merge pull request #2 from scientificcomputing/dokken/updates
Improve CI and JB
2 parents 57e8c8c + d50bf96 commit eb9eaff

5 files changed

Lines changed: 67 additions & 43 deletions

File tree

.github/workflows/build_docs.yml

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
name: Github Pages
22

33
on:
4-
push:
5-
branches:
6-
- "**"
4+
pull_request:
5+
branches: ["main"]
76

8-
# Allows you to run this workflow manually from the Actions tab
7+
# Allows you to run this workflow manually from the Actions tab
98
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-
9+
workflow_call:
2210

2311
jobs:
2412
build:
25-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-latest
2614
env:
2715
# Directory that will be published on github pages
2816
PUBLISH_DIR: ./_build/html
@@ -40,29 +28,10 @@ jobs:
4028

4129
- name: Build docs
4230
run: jupyter book build .
43-
44-
- name: Upload artifact
45-
uses: actions/upload-pages-artifact@v1
31+
32+
- name: Upload documentation as artifact
33+
uses: actions/upload-artifact@v3
4634
with:
35+
name: documentation
4736
path: ${{ env.PUBLISH_DIR }}
48-
49-
50-
# Single deploy job since we're just deploying
51-
deploy:
52-
if: github.ref == 'refs/heads/main'
53-
needs: build
54-
environment:
55-
name: github-pages
56-
url: ${{ steps.deployment.outputs.page_url }}
57-
58-
runs-on: ubuntu-latest
59-
steps:
60-
- name: Checkout
61-
uses: actions/checkout@v3
62-
63-
- name: Setup Pages
64-
uses: actions/configure-pages@v2
65-
66-
- name: Deploy to GitHub Pages
67-
id: deployment
68-
uses: actions/deploy-pages@v1
37+
if-no-files-found: error

.github/workflows/deploy.yml

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

.github/workflows/docker-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ jobs:
4242

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

4949
- name: Build and push Docker image
50-
uses: docker/build-push-action@v3
50+
uses: docker/build-push-action@v4
5151
with:
5252
context: .
5353
push: true

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ parse:
3333
sphinx:
3434
config:
3535
bibtex_bibfiles: ["docs/refs.bib"]
36+
html_last_updated_fmt: "%b %d, %Y"
3637

3738
extra_extensions:
3839
- 'sphinx.ext.autodoc'

docs/logo.png

11.4 KB
Loading

0 commit comments

Comments
 (0)