Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
update path
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchobben committed Jul 18, 2024
1 parent 0aadef4 commit c2d9fac
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
steps:
- name: Checkout Quarto Book
uses: actions/checkout@v4
with:
path: main

- name: Checkout Pythia Book
uses: actions/checkout@v4
Expand All @@ -29,16 +27,18 @@ jobs:
id: setup-python
uses: quarto-dev/quarto-actions/publish@v2
with:
path: main
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: echo $(ls ~/.local/share/jupyter/kernels)

- name: Cache Jupyter Kernels
uses: actions/cache@v3
with:
path: ~/.local/share/jupyter/kernels
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-jupyter-${{ hashFiles('chapters/*.yml') }}
key: ${{ runner.os }}-jupyter-${{ hashFiles('chapters/*.yml') }}
restore-keys: ${{ runner.os }}-jupyter

# - name: Cache Binder Build on mybinder.org
# uses: jupyterhub/repo2docker-action@master
Expand All @@ -47,15 +47,15 @@ jobs:
# MYBINDERORG_TAG: ${{ github.event.ref }}
# REPO2DOCKER_EXTRA_ARGS: --subdir notebooks

- run: echo $(ls $(pwd)/notebooks)

- name: Commit Files
if: github.ref == 'refs/heads/main'
run: |
cp main/notebooks/*.ipynb eo-datascience-cookbook/notebooks/*.ipynb
cd eo-datascience-cookbook
NB_PATH=$(pwd)/notebooks
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add notebooks/*.ipynb
git commit -m "Quarto output"
git commit ${NB_PATH[*]/.ipynb} -m "Quarto output"
- name: Push Commit
if: github.ref == 'refs/heads/main'
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
.env
/.quarto/
/_book/
/data/
/**/*.ipynb
/data/
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
SHELL = /bin/bash
.PHONY: help clean environment kernel post-render data
YML = $(wildcard chapters/*.yml)
QMD = $(wildcard chapters/*.qmd)
REQ = $(basename $(notdir $(YML)))
CONDA_ENV_DIR := $(foreach i,$(REQ),$(shell conda info --base)/envs/$(i))
KERNEL_DIR := $(foreach i,$(REQ),$(shell jupyter --data-dir)/kernels/$(i))
Expand Down Expand Up @@ -34,7 +35,9 @@ kernel: $(KERNEL_DIR)
@echo -e "conda jupyter kernel is ready."

post-render:
for i in $(QMD); do quarto convert $$i; done
- mv chapters/*.ipynb notebooks/ >/dev/null 2>&1
- for f in chapters/*.quarto_ipynb ; do mv -- "$f" "${f%.quarto_ipynb}.ipynb" >/dev/null 2>&1; done
cp Makefile notebooks/

data:
Expand Down
1 change: 0 additions & 1 deletion chapters/01_classification.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ jupyter:
name: "01_classification"
language: "python"
display_name: "01_classification"
keep-ipynb: true
---

```{python}
Expand Down
2 changes: 0 additions & 2 deletions chapters/02_floodmapping.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ jupyter:
name: "02_floodmapping"
language: "python"
display_name: "02_floodmapping"
keep-ipynb: true
code-fold: true
---

![Image from [wikipedia](https://upload.wikimedia.org/wikipedia/commons/d/d4/Thomas_Bayes.gif)](https://upload.wikimedia.org/wikipedia/commons/d/d4/Thomas_Bayes.gif)
Expand Down

0 comments on commit c2d9fac

Please sign in to comment.