From fb769368c38726f47eaa48b3d81905a85e85b887 Mon Sep 17 00:00:00 2001 From: chvmvd Date: Fri, 3 Feb 2023 15:50:44 +0900 Subject: [PATCH 1/2] Add scripts executing notebooks --- .github/actions/execute_notebooks/action.yml | 10 ++++++++++ .github/workflows/deploy.yml | 3 +++ .github/workflows/preview.yml | 3 +++ package.json | 3 ++- 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .github/actions/execute_notebooks/action.yml diff --git a/.github/actions/execute_notebooks/action.yml b/.github/actions/execute_notebooks/action.yml new file mode 100644 index 000000000..15eab308d --- /dev/null +++ b/.github/actions/execute_notebooks/action.yml @@ -0,0 +1,10 @@ +--- +runs: + using: "Composite" + steps: + - name: Install Python Modules + uses: ./.github/actions/install_python_mudules + + - name: Execute Notebooks + run: npm run execute_notebooks + shell: bash diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2874b7bcb..b7feddbdb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,6 +17,9 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 + - name: Execute notebooks + uses: ./.github/actions/execute_notebooks + - name: Build uses: ./.github/actions/build diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index ac7676485..810a2122c 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -21,6 +21,9 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 + - name: Execute Notebooks + uses: ./.github/actions/execute_notebooks + - name: Build uses: ./.github/actions/build diff --git a/package.json b/package.json index 57ed2555c..f321b66df 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", - "typecheck": "tsc" + "typecheck": "tsc", + "execute_notebooks": "jupyter nbconvert --inplace --to notebook --execute --allow-errors static/**/*" }, "dependencies": { "@docusaurus/core": "^2.3.0", From a59962adb138b4bc87996ab331052cd21ade2384 Mon Sep 17 00:00:00 2001 From: chvmvd Date: Fri, 3 Feb 2023 15:58:34 +0900 Subject: [PATCH 2/2] Delete output from hello-world.ipynb --- static/hello-world/hello-world.ipynb | 36 +++++++++++----------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/static/hello-world/hello-world.ipynb b/static/hello-world/hello-world.ipynb index 5cf05b7d9..6bdc20ca5 100644 --- a/static/hello-world/hello-world.ipynb +++ b/static/hello-world/hello-world.ipynb @@ -1,24 +1,16 @@ { - "nbformat": 4, - "nbformat_minor": 2, - "metadata": {}, - "cells": [ - { - "metadata": {}, - "source": [ - "print(\"Hello World!\")" - ], - "cell_type": "code", - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Hello World!\n" - ] - } - ], - "execution_count": null - } - ] + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(\"Hello World!\")" + ] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 2 }