From 57f88aadb11c32542a55d4f8228e21cefb573273 Mon Sep 17 00:00:00 2001 From: Christopher Sampson Date: Mon, 23 Oct 2023 14:24:57 +0100 Subject: [PATCH 1/8] actions workings --- .github/deploy_book.yml | 17 ++++++ .idea/.gitignore | 8 +++ .idea/PythonAnalysisLessons.iml | 8 +++ .idea/misc.xml | 7 +++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 6 +++ Lesson 1.ipynb | 92 +++++++++++++++++++++++++++------ _config.yml | 2 + _toc.yml | 2 + 9 files changed, 135 insertions(+), 15 deletions(-) create mode 100644 .github/deploy_book.yml create mode 100644 .idea/.gitignore create mode 100644 .idea/PythonAnalysisLessons.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 _config.yml create mode 100644 _toc.yml diff --git a/.github/deploy_book.yml b/.github/deploy_book.yml new file mode 100644 index 0000000..9c86b87 --- /dev/null +++ b/.github/deploy_book.yml @@ -0,0 +1,17 @@ +name: deploy-book + +on: + push: + branches: + - '*' + +jobs: + deploy-book: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: conda env create + run: | + source 'usr/share/miniconda/etc/profile.d/conda.sh' + conda create -n jbook -c conda-forge jupyter-book python=3.11 \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/PythonAnalysisLessons.iml b/.idea/PythonAnalysisLessons.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/PythonAnalysisLessons.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5137166 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..25faeb1 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Lesson 1.ipynb b/Lesson 1.ipynb index fca541f..1f12eea 100644 --- a/Lesson 1.ipynb +++ b/Lesson 1.ipynb @@ -22,8 +22,13 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2023-10-17T07:51:53.208397Z", + "start_time": "2023-10-17T07:51:53.190984800Z" + } + }, "outputs": [], "source": [ "x = 3" @@ -45,9 +50,23 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2023-10-17T07:51:53.217418800Z", + "start_time": "2023-10-17T07:51:53.200378300Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": "3" + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "x" ] @@ -69,9 +88,28 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2023-10-17T07:51:53.227066200Z", + "start_time": "2023-10-17T07:51:53.213389600Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "6\n", + "9\n", + "1.5\n", + "1\n", + "5\n", + "1\n", + "False\n" + ] + } + ], "source": [ "#This is a comment\n", "#We can use comments to explain why we do something\n", @@ -139,8 +177,13 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2023-10-17T07:51:53.234460700Z", + "start_time": "2023-10-17T07:51:53.224439100Z" + } + }, "outputs": [], "source": [ "def multiply2NumbersTogether(number1, number2):\n", @@ -157,9 +200,23 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2023-10-17T07:51:53.284037Z", + "start_time": "2023-10-17T07:51:53.233069700Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": "6" + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "multiply2NumbersTogether(2, 3)" ] @@ -207,8 +264,13 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2023-10-17T07:51:53.284037Z", + "start_time": "2023-10-17T07:51:53.238992Z" + } + }, "outputs": [], "source": [] } diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..2334eb3 --- /dev/null +++ b/_config.yml @@ -0,0 +1,2 @@ +title: Python Analysis Lessons +author: CSampson \ No newline at end of file diff --git a/_toc.yml b/_toc.yml new file mode 100644 index 0000000..4730e62 --- /dev/null +++ b/_toc.yml @@ -0,0 +1,2 @@ +format: jb-book +root: Lesson 1 \ No newline at end of file From fe72657ee56da15a909d63b4d49c36200372b6d1 Mon Sep 17 00:00:00 2001 From: Christopher Sampson Date: Mon, 23 Oct 2023 14:27:49 +0100 Subject: [PATCH 2/8] Revert "actions workings" This reverts commit 57f88aadb11c32542a55d4f8228e21cefb573273. --- .github/deploy_book.yml | 17 ------ .idea/.gitignore | 8 --- .idea/PythonAnalysisLessons.iml | 8 --- .idea/misc.xml | 7 --- .idea/modules.xml | 8 --- .idea/vcs.xml | 6 --- Lesson 1.ipynb | 92 ++++++--------------------------- _config.yml | 2 - _toc.yml | 2 - 9 files changed, 15 insertions(+), 135 deletions(-) delete mode 100644 .github/deploy_book.yml delete mode 100644 .idea/.gitignore delete mode 100644 .idea/PythonAnalysisLessons.iml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 _config.yml delete mode 100644 _toc.yml diff --git a/.github/deploy_book.yml b/.github/deploy_book.yml deleted file mode 100644 index 9c86b87..0000000 --- a/.github/deploy_book.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: deploy-book - -on: - push: - branches: - - '*' - -jobs: - deploy-book: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: conda env create - run: | - source 'usr/share/miniconda/etc/profile.d/conda.sh' - conda create -n jbook -c conda-forge jupyter-book python=3.11 \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/PythonAnalysisLessons.iml b/.idea/PythonAnalysisLessons.iml deleted file mode 100644 index d0876a7..0000000 --- a/.idea/PythonAnalysisLessons.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 5137166..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 25faeb1..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Lesson 1.ipynb b/Lesson 1.ipynb index 1f12eea..fca541f 100644 --- a/Lesson 1.ipynb +++ b/Lesson 1.ipynb @@ -22,13 +22,8 @@ }, { "cell_type": "code", - "execution_count": 1, - "metadata": { - "ExecuteTime": { - "end_time": "2023-10-17T07:51:53.208397Z", - "start_time": "2023-10-17T07:51:53.190984800Z" - } - }, + "execution_count": null, + "metadata": {}, "outputs": [], "source": [ "x = 3" @@ -50,23 +45,9 @@ }, { "cell_type": "code", - "execution_count": 2, - "metadata": { - "ExecuteTime": { - "end_time": "2023-10-17T07:51:53.217418800Z", - "start_time": "2023-10-17T07:51:53.200378300Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": "3" - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "x" ] @@ -88,28 +69,9 @@ }, { "cell_type": "code", - "execution_count": 3, - "metadata": { - "ExecuteTime": { - "end_time": "2023-10-17T07:51:53.227066200Z", - "start_time": "2023-10-17T07:51:53.213389600Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "6\n", - "9\n", - "1.5\n", - "1\n", - "5\n", - "1\n", - "False\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "#This is a comment\n", "#We can use comments to explain why we do something\n", @@ -177,13 +139,8 @@ }, { "cell_type": "code", - "execution_count": 4, - "metadata": { - "ExecuteTime": { - "end_time": "2023-10-17T07:51:53.234460700Z", - "start_time": "2023-10-17T07:51:53.224439100Z" - } - }, + "execution_count": null, + "metadata": {}, "outputs": [], "source": [ "def multiply2NumbersTogether(number1, number2):\n", @@ -200,23 +157,9 @@ }, { "cell_type": "code", - "execution_count": 5, - "metadata": { - "ExecuteTime": { - "end_time": "2023-10-17T07:51:53.284037Z", - "start_time": "2023-10-17T07:51:53.233069700Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": "6" - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "multiply2NumbersTogether(2, 3)" ] @@ -264,13 +207,8 @@ }, { "cell_type": "code", - "execution_count": 5, - "metadata": { - "ExecuteTime": { - "end_time": "2023-10-17T07:51:53.284037Z", - "start_time": "2023-10-17T07:51:53.238992Z" - } - }, + "execution_count": null, + "metadata": {}, "outputs": [], "source": [] } diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 2334eb3..0000000 --- a/_config.yml +++ /dev/null @@ -1,2 +0,0 @@ -title: Python Analysis Lessons -author: CSampson \ No newline at end of file diff --git a/_toc.yml b/_toc.yml deleted file mode 100644 index 4730e62..0000000 --- a/_toc.yml +++ /dev/null @@ -1,2 +0,0 @@ -format: jb-book -root: Lesson 1 \ No newline at end of file From 684cf5b4c3e34b7621f0ffa927df4aa80108b7e1 Mon Sep 17 00:00:00 2001 From: Christopher Sampson Date: Mon, 23 Oct 2023 14:33:38 +0100 Subject: [PATCH 3/8] actions workings pt2 --- .github/deploy_book.yml | 18 ++++++++++++++++++ .gitignore | 1 + _config.yml | 2 ++ _toc.yml | 2 ++ 4 files changed, 23 insertions(+) create mode 100644 .github/deploy_book.yml create mode 100644 .gitignore create mode 100644 _config.yml create mode 100644 _toc.yml diff --git a/.github/deploy_book.yml b/.github/deploy_book.yml new file mode 100644 index 0000000..7d795d8 --- /dev/null +++ b/.github/deploy_book.yml @@ -0,0 +1,18 @@ +name: deploy-book + +on: + push: + branches: + - '*' + - '*/*' + +jobs: + deploy-book: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: conda env create + run: | + source '/usr/share/miniconda/etc/profile.d/conda.sh' + conda create -n jbook -c conda-forge jupyter-book python=3.11 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62c8935 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ \ No newline at end of file diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..2334eb3 --- /dev/null +++ b/_config.yml @@ -0,0 +1,2 @@ +title: Python Analysis Lessons +author: CSampson \ No newline at end of file diff --git a/_toc.yml b/_toc.yml new file mode 100644 index 0000000..4730e62 --- /dev/null +++ b/_toc.yml @@ -0,0 +1,2 @@ +format: jb-book +root: Lesson 1 \ No newline at end of file From 8d07e4658d3c9a2cfed143eb624dc6d73b234ce7 Mon Sep 17 00:00:00 2001 From: Christopher Sampson Date: Mon, 23 Oct 2023 14:57:40 +0100 Subject: [PATCH 4/8] build test --- .github/deploy_book.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/deploy_book.yml b/.github/deploy_book.yml index 7d795d8..4b4396c 100644 --- a/.github/deploy_book.yml +++ b/.github/deploy_book.yml @@ -15,4 +15,9 @@ jobs: - name: conda env create run: | source '/usr/share/miniconda/etc/profile.d/conda.sh' - conda create -n jbook -c conda-forge jupyter-book python=3.11 \ No newline at end of file + conda create -n jbook -c conda-forge jupyter-book python=3.11 + + # Build the book + - name: Build the book + run: | + jupyter-book build . \ No newline at end of file From db1ee574fbbc7604518ad821f2cbe5ae4d51cc49 Mon Sep 17 00:00:00 2001 From: Christopher Sampson Date: Tue, 24 Oct 2023 06:09:19 +0100 Subject: [PATCH 5/8] Moved workflow --- .github/{ => workflows}/deploy_book.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/deploy_book.yml (100%) diff --git a/.github/deploy_book.yml b/.github/workflows/deploy_book.yml similarity index 100% rename from .github/deploy_book.yml rename to .github/workflows/deploy_book.yml From d945e372262a3ff8d64b5779749d302fc1562bc2 Mon Sep 17 00:00:00 2001 From: Christopher Sampson Date: Tue, 24 Oct 2023 06:12:25 +0100 Subject: [PATCH 6/8] build book update --- .github/workflows/deploy_book.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_book.yml b/.github/workflows/deploy_book.yml index 4b4396c..c18d29e 100644 --- a/.github/workflows/deploy_book.yml +++ b/.github/workflows/deploy_book.yml @@ -17,7 +17,8 @@ jobs: source '/usr/share/miniconda/etc/profile.d/conda.sh' conda create -n jbook -c conda-forge jupyter-book python=3.11 - # Build the book - name: Build the book run: | + source '/usr/share/miniconda/etc/profile.d/conda.sh' + conda activate jbook jupyter-book build . \ No newline at end of file From 098bbb6bb118147e67f2953a41b8a057648d43d6 Mon Sep 17 00:00:00 2001 From: Christopher Sampson Date: Tue, 24 Oct 2023 06:28:45 +0100 Subject: [PATCH 7/8] deploy book workflow --- .github/workflows/deploy_book.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_book.yml b/.github/workflows/deploy_book.yml index c18d29e..84c77e8 100644 --- a/.github/workflows/deploy_book.yml +++ b/.github/workflows/deploy_book.yml @@ -21,4 +21,14 @@ jobs: run: | source '/usr/share/miniconda/etc/profile.d/conda.sh' conda activate jbook - jupyter-book build . \ No newline at end of file + jupyter-book build . + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + # Upload entire repository + path: '_build/html/' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 \ No newline at end of file From 5965f56d516b26aa881feb4b524ac5b27e5a4a8a Mon Sep 17 00:00:00 2001 From: Christopher Sampson Date: Tue, 24 Oct 2023 06:32:49 +0100 Subject: [PATCH 8/8] updated permissions --- .github/workflows/deploy_book.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/deploy_book.yml b/.github/workflows/deploy_book.yml index 84c77e8..0c9a791 100644 --- a/.github/workflows/deploy_book.yml +++ b/.github/workflows/deploy_book.yml @@ -6,6 +6,11 @@ on: - '*' - '*/*' +permissions: + contents: read + pages: write + id-token: write + jobs: deploy-book: runs-on: ubuntu-latest