Skip to content

Commit ed0cc3b

Browse files
authored
Publish to GH pages. (#24)
1 parent ae9586c commit ed0cc3b

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/cd.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
name: Publish
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
schedule:
9+
- cron: '0 5 * * 1'
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
19+
build:
20+
name: Build Jupyter Notebooks and HTML
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup GitHub Pages
27+
uses: actions/configure-pages@v5
28+
29+
- name: Setup pixi
30+
uses: prefix-dev/setup-pixi@19eac09b398e3d0c747adc7921926a6d802df4da # v0.8.8
31+
with:
32+
cache: true
33+
cache-write: true
34+
35+
- name: Build executed notebooks and HTML
36+
run: pixi run build
37+
38+
- name: Upload executed notebooks as GitHub artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: executed-notebooks
42+
path: _build/jupyter_execute/tutorials
43+
if-no-files-found: error
44+
45+
- name: Upload HTML as GitHub artifact (for debugging)
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: build/html
49+
50+
deploy-gh-pages:
51+
name: Deploy HTML to GitHub Pages
52+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
53+
permissions:
54+
contents: read
55+
pages: write
56+
id-token: write
57+
58+
environment:
59+
name: github-pages
60+
url: ${{ steps.deployment.outputs.page_url }}
61+
runs-on: ubuntu-latest
62+
needs: build
63+
steps:
64+
- name: Deploy HTML to GitHub Pages
65+
id: deployment
66+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)