Skip to content

Commit a61f385

Browse files
committed
poetry test
1 parent acfd5f2 commit a61f385

File tree

3 files changed

+2251
-0
lines changed

3 files changed

+2251
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Convert and Publish Notebooks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
convert-and-publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/[email protected]
15+
16+
- name: Set up Python
17+
uses: actions/[email protected]
18+
with:
19+
python-version: '3.12'
20+
21+
- name: Install Dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install jupyter nbconvert quarto-cli
25+
26+
- name: Convert Notebooks to QMD
27+
run: |
28+
mkdir -p qmd
29+
for notebook in $(find . -name "*.ipynb"); do
30+
jupyter nbconvert --to markdown --output-dir=qmd "$notebook"
31+
done
32+
33+
- name: Create Index File
34+
run: |
35+
echo "# Index" > qmd/index.qmd
36+
for file in $(ls qmd/*.md); do
37+
title=$(basename "$file" .md)
38+
echo "- [$title](./$title.html)" >> qmd/index.qmd
39+
done
40+
41+
- name: Render QMD Files
42+
run: |
43+
mkdir -p rendered
44+
for qmd in $(find qmd -name "*.qmd"); do
45+
quarto render "$qmd" --to html --output-dir rendered
46+
done
47+
48+
- name: Move rendered files to docs
49+
run: |
50+
rm -rf ./docs
51+
mv ./rendered ./docs
52+
echo "" > ./docs/.nojekyll
53+
54+
- name: Push changes
55+
uses: ad-m/[email protected]
56+
with:
57+
github_token: ${{ secrets.GITHUB_TOKEN }}
58+
branch: main

0 commit comments

Comments
 (0)