Skip to content

Commit fae16b5

Browse files
committed
move
1 parent d0b0921 commit fae16b5

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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.11'
20+
21+
- name: Install Jupyter and Quarto
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: Render QMD Files
34+
run: |
35+
for qmd in $(find qmd -name "*.md"); do
36+
quarto render "$qmd" --output-dir rendered
37+
done
38+
39+
- name: Create Markdown Content
40+
run: |
41+
echo "# Portfolio" > rendered/index.md
42+
for rendered_file in $(find rendered -name "*.html"); do
43+
echo "- [$(basename "$rendered_file" .html)]($rendered_file)" >> rendered/index.md
44+
done
45+
46+
- name: Deploy to GitHub Pages
47+
uses: peaceiris/actions-gh-pages@v4
48+
with:
49+
github_token: ${{ secrets.GITHUB_TOKEN }}
50+
publish_dir: ./rendered

0 commit comments

Comments
 (0)