From 4232d596c8b6f38f704394e38969e59db179a76b Mon Sep 17 00:00:00 2001 From: Diane Adjavon Date: Thu, 25 Jul 2024 15:20:12 -0400 Subject: [PATCH] Add workflow for building notebooks --- .github/workflows/build-notebooks.yaml | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/build-notebooks.yaml diff --git a/.github/workflows/build-notebooks.yaml b/.github/workflows/build-notebooks.yaml new file mode 100644 index 0000000..c68235e --- /dev/null +++ b/.github/workflows/build-notebooks.yaml @@ -0,0 +1,32 @@ +name: Build Notebooks +on: + push: + +jobs: + run: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install jupytext nbconvert + + + - name: Build notebooks + run: | + jupytext --to ipynb --update-metadata '{"jupytext":{"cell_metadata_filter":"all"}}' solution.py + + jupyter nbconvert solution.ipynb --TagRemovePreprocessor.enabled=True --TagRemovePreprocessor.remove_cell_tags solution --to notebook --output exercise.ipynb + jupyter nbconvert solution.ipynb --TagRemovePreprocessor.enabled=True --TagRemovePreprocessor.remove_cell_tags task --to notebook --output solution.ipynb + + - uses: EndBug/add-and-commit@v9 + with: + add: solution.ipynb exercise.ipynb \ No newline at end of file