From 7bec8c9712fcfe8012106159b5c38623b57c7ac6 Mon Sep 17 00:00:00 2001 From: acocac Date: Mon, 21 Apr 2025 15:51:48 +0100 Subject: [PATCH 1/9] rm contributions sections --- notebook.ipynb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/notebook.ipynb b/notebook.ipynb index 83445e8..3877f73 100644 --- a/notebook.ipynb +++ b/notebook.ipynb @@ -18,10 +18,6 @@ "* Highlight 1\n", "* Highlight 2\n", "\n", - "### Contributions\n", - "*Please indicate key contributions. Notebook authors (mandatory). Optional subheadings, used in published EDS book notebooks, are Dataset originator/creator, Dataset authors, Dataset documentation, Modelling codebase, Modelling publications, Modelling funding and Pipeline documentation. Feel free to add any of them or propose new ones to attribute relevant research contributions.*\n", - "\n", - "#### Notebook\n", "* Author (role), Affiliation, GitHub alias\n", "\n", ":::{note}\n", From d68c722d8966c057c38fc72358a7db2fcc56981d Mon Sep 17 00:00:00 2001 From: acocac Date: Mon, 21 Apr 2025 15:55:51 +0100 Subject: [PATCH 2/9] rm license in additional information --- notebook.ipynb | 2 -- 1 file changed, 2 deletions(-) diff --git a/notebook.ipynb b/notebook.ipynb index 3877f73..f05d7dd 100644 --- a/notebook.ipynb +++ b/notebook.ipynb @@ -138,8 +138,6 @@ "\n", "**Codebase**: Type here details of codebase version (only for notebooks categorised under modelling/preprocesing/post-processing themes).\n", "\n", - "**License**: The code in this notebook is licensed under the MIT License. The Environmental Data Science book is licensed under the Creative Commons by Attribution 4.0 license. See further details [here](https://github.com/alan-turing-institute/environmental-ds-book/blob/master/LICENSE.md).\n", - "\n", "**Contact**: If you have any suggestion or report an issue with this notebook, feel free to [create an issue](https://github.com/alan-turing-institute/environmental-ds-book/issues/new/choose) or send a direct message to [environmental.ds.book@gmail.com](mailto:environmental.ds.book@gmail.com)." ] }, From d8047eda66f751406b24d1af2b9c9b8cdad4f03e Mon Sep 17 00:00:00 2001 From: acocac Date: Mon, 21 Apr 2025 15:56:21 +0100 Subject: [PATCH 3/9] set references.bib --- references.bib | 1 + 1 file changed, 1 insertion(+) create mode 100644 references.bib diff --git a/references.bib b/references.bib new file mode 100644 index 0000000..855af04 --- /dev/null +++ b/references.bib @@ -0,0 +1 @@ +# notebook references in BibTeX format \ No newline at end of file From 0624b966f8cb4368b51d3f82bc051eff613764cc Mon Sep 17 00:00:00 2001 From: acocac Date: Mon, 21 Apr 2025 15:58:06 +0100 Subject: [PATCH 4/9] add missing period --- notebook.ipynb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/notebook.ipynb b/notebook.ipynb index f05d7dd..7d4980c 100644 --- a/notebook.ipynb +++ b/notebook.ipynb @@ -11,15 +11,13 @@ "*Describe the purpose of the use case.*\n", "\n", "### Description\n", - "*Describe the main features of the dataset/sensor, preprocessing, modelling or postprocessing routine*\n", + "*Describe the main features of the dataset/sensor, preprocessing, modelling or postprocessing routine.*\n", "\n", "### Highlights\n", "*Provide 3-5 bullet points that convey the use case’s core procedures. Each bullet point must have a maximum of 85 characters, including spaces.*\n", "* Highlight 1\n", "* Highlight 2\n", "\n", - "* Author (role), Affiliation, GitHub alias\n", - "\n", ":::{note}\n", "*Optional: add credits or acknowledgements to data and/or model providers or authors of code snippets*\n", ":::" From 81f9ef6418d3e695bea93767d8917bbf0fad31ce Mon Sep 17 00:00:00 2001 From: acocac Date: Mon, 21 Apr 2025 15:58:27 +0100 Subject: [PATCH 5/9] change org --- .github/workflows/build.yaml | 2 +- .github/workflows/preview.yaml | 6 +++--- .github/workflows/test.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8b49ac5..3cefe13 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,7 +9,7 @@ on: jobs: build-and-push: runs-on: ubuntu-latest - if: github.repository_owner == 'eds-book-gallery' + if: github.repository_owner == 'eds-book' steps: # For biggish images, github actions runs out of disk space. # So we cleanup some unwanted things in the disk image, and reclaim that space for our docker use diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 21ef3ae..5a1037d 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -5,12 +5,12 @@ on: workflows: ["Build and push container image"] branches: [postprint] types: [completed] - + # This job installs dependencies, build the jupyter notebook, and pushes it to `preview`, a new `branch` jobs: on-success: runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'eds-book-gallery' && github.event.workflow_run.conclusion == 'success' }} + if: ${{ github.repository_owner == 'eds-book' && github.event.workflow_run.conclusion == 'success' }} defaults: run: shell: bash -l {0} @@ -68,7 +68,7 @@ jobs: force: true on-failure: runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'eds-book-gallery' && github.event.workflow_run.conclusion == 'failure' }} + if: ${{ github.repository_owner == 'eds-book' && github.event.workflow_run.conclusion == 'failure' }} steps: - name: Check conditions meet run: echo 'The triggering workflow failed' \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 69140db..1f7cb64 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,7 +6,7 @@ on: jobs: test-build: runs-on: ubuntu-latest - if: github.repository_owner == 'eds-book-gallery' + if: github.repository_owner == 'eds-book' steps: # For biggish images, github actions runs out of disk space. From b008fe667483f50643255da84453571473983b5a Mon Sep 17 00:00:00 2001 From: acocac Date: Mon, 21 Apr 2025 15:58:39 +0100 Subject: [PATCH 6/9] set deploy --- .github/workflows/deploy.yml | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..40e2be2 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,52 @@ +# This file was created automatically with `myst init --gh-pages` 🪄 💚 + +name: MyST GitHub Pages Deploy +on: + workflow_run: + workflows: ["Execute Notebook"] + branches: main + types: + - completed + +env: + # `BASE_URL` determines the website is served from, including CSS & JS assets + # You may need to change this to `BASE_URL: ''` + BASE_URL: /${{ github.event.repository.name }} + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: 'pages' + cancel-in-progress: false +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + if: github.repository_owner == 'eds-book' + steps: + - uses: actions/checkout@v4 + with: + ref: render + - name: Setup Pages + uses: actions/configure-pages@v3 + - uses: actions/setup-node@v4 + with: + node-version: 18.x + - name: Install MyST Markdown + run: npm install -g mystmd + - name: Build HTML Assets + run: myst build --html + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './_build/html' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From 363f878841906c36d265ed696f75856f077a6f46 Mon Sep 17 00:00:00 2001 From: acocac Date: Mon, 21 Apr 2025 15:58:48 +0100 Subject: [PATCH 7/9] set execute --- .github/workflows/execute.yaml | 91 ++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/execute.yaml diff --git a/.github/workflows/execute.yaml b/.github/workflows/execute.yaml new file mode 100644 index 0000000..60287e9 --- /dev/null +++ b/.github/workflows/execute.yaml @@ -0,0 +1,91 @@ +name: Execute Notebook + +on: + workflow_run: + workflows: ["Build and push container image"] + branches: main + types: + - completed + +env: + # `BASE_URL` determines the website is served from, including CSS & JS assets + # You may need to change this to `BASE_URL: ''` + BASE_URL: /${{ github.event.repository.name }} + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: write-all + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: 'pages' + cancel-in-progress: false + +# This job installs dependencies, build the jupyter notebook, and pushes it to `render`, a new `branch` +jobs: + build: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + +# permissions: +# id-token: write +# pages: write + + if: github.repository_owner == 'eds-book' + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest"] + defaults: + run: + shell: bash -l {0} + steps: + - uses: actions/checkout@v2 + # Set notebook name + - name: Get properties from the config file + id: config_file + uses: notiz-dev/github-action-json-property@release + with: + path: '.github/config.json' + prop_path: 'notebook_name' + # Set quay image + - name: Get properties from the config file + id: config_quay + uses: notiz-dev/github-action-json-property@release + with: + path: '.github/config.json' + prop_path: 'quay_image' + # Set kernel name + - name: Get properties from the config file + id: config_kernel + uses: notiz-dev/github-action-json-property@release + with: + path: '.github/config.json' + prop_path: 'kernel' + # Render the notebook + - name: Run the build process with Docker + uses: addnab/docker-run-action@v3 + with: + image: quay.io/${{steps.config_quay.outputs.prop}}:latest + options: --user root -v ${{ github.workspace }}:/tmp + shell: bash + run: | + v=$(jupyter kernelspec list | awk '{print $1}' | egrep ${{steps.config_kernel.outputs.prop}}) + jupyter-nbconvert --to notebook --ExecutePreprocessor.kernel_name="$v" --inplace --execute ${{steps.config_file.outputs.prop}} + cp ${{steps.config_file.outputs.prop}} /tmp + - name: Commit + run: | + ls + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add ${{steps.config_file.outputs.prop}} + git commit -m 'update' + - name: Push + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: render + force: true \ No newline at end of file From 117b59c86d296ebf04b04b602ab9f7b3e24251eb Mon Sep 17 00:00:00 2001 From: acocac Date: Fri, 2 May 2025 10:16:53 +0100 Subject: [PATCH 8/9] rm old files --- .github/config.json | 5 --- .github/workflows/deploy.yml | 52 ------------------------ .github/workflows/preview.yaml | 74 ---------------------------------- .github/workflows/render.yaml | 71 -------------------------------- 4 files changed, 202 deletions(-) delete mode 100644 .github/config.json delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/preview.yaml delete mode 100644 .github/workflows/render.yaml diff --git a/.github/config.json b/.github/config.json deleted file mode 100644 index d75c5db..0000000 --- a/.github/config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "notebook_name": "", - "kernel": "", - "quay_image": "" -} \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 40e2be2..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,52 +0,0 @@ -# This file was created automatically with `myst init --gh-pages` 🪄 💚 - -name: MyST GitHub Pages Deploy -on: - workflow_run: - workflows: ["Execute Notebook"] - branches: main - types: - - completed - -env: - # `BASE_URL` determines the website is served from, including CSS & JS assets - # You may need to change this to `BASE_URL: ''` - BASE_URL: /${{ github.event.repository.name }} - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: 'pages' - cancel-in-progress: false -jobs: - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - if: github.repository_owner == 'eds-book' - steps: - - uses: actions/checkout@v4 - with: - ref: render - - name: Setup Pages - uses: actions/configure-pages@v3 - - uses: actions/setup-node@v4 - with: - node-version: 18.x - - name: Install MyST Markdown - run: npm install -g mystmd - - name: Build HTML Assets - run: myst build --html - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: './_build/html' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml deleted file mode 100644 index 5a1037d..0000000 --- a/.github/workflows/preview.yaml +++ /dev/null @@ -1,74 +0,0 @@ -name: Preview - -on: - workflow_run: - workflows: ["Build and push container image"] - branches: [postprint] - types: [completed] - -# This job installs dependencies, build the jupyter notebook, and pushes it to `preview`, a new `branch` -jobs: - on-success: - runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'eds-book' && github.event.workflow_run.conclusion == 'success' }} - defaults: - run: - shell: bash -l {0} - steps: - - name: Check conditions meet - run: echo 'The triggering workflow passed' - - uses: actions/checkout@v2 - with: - ref: postprint - # Set notebook name - - name: Get properties from the config file - id: config_file - uses: notiz-dev/github-action-json-property@release - with: - path: '.github/config.json' - prop_path: 'notebook_name' - # Set quay image - - name: Get properties from the config file - id: config_quay - uses: notiz-dev/github-action-json-property@release - with: - path: '.github/config.json' - prop_path: 'quay_image' - # Set kernel name - - name: Get properties from the config file - id: config_kernel - uses: notiz-dev/github-action-json-property@release - with: - path: '.github/config.json' - prop_path: 'kernel' - # Render the notebook - - name: Run the build process with Docker - uses: addnab/docker-run-action@v3 - with: - image: quay.io/${{steps.config_quay.outputs.prop}}:latest - options: --user root -v ${{ github.workspace }}:/tmp - shell: bash - run: | - v=$(jupyter kernelspec list | awk '{print $1}' | egrep ${{steps.config_kernel.outputs.prop}}) - jupyter-nbconvert --to notebook --ExecutePreprocessor.kernel_name="$v" --inplace --execute ${{steps.config_file.outputs.prop}} - cp ${{steps.config_file.outputs.prop}} /tmp - - name: Commit - run: | - ls - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git rm \* ':!${{steps.config_file.outputs.prop}}' - git add ${{steps.config_file.outputs.prop}} - git commit -m 'update' - - name: Push - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: preview - force: true - on-failure: - runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'eds-book' && github.event.workflow_run.conclusion == 'failure' }} - steps: - - name: Check conditions meet - run: echo 'The triggering workflow failed' \ No newline at end of file diff --git a/.github/workflows/render.yaml b/.github/workflows/render.yaml deleted file mode 100644 index cde78a4..0000000 --- a/.github/workflows/render.yaml +++ /dev/null @@ -1,71 +0,0 @@ -name: Render - -on: - workflow_run: - workflows: ["Build and push container image"] - branches: main - types: - - completed - -# This job installs dependencies, build the jupyter notebook, and pushes it to `render`, a new `branch` -jobs: - build: - name: ${{ matrix.os }} - runs-on: ${{ matrix.os }} - - if: github.repository_owner == 'eds-book-gallery' - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest"] - defaults: - run: - shell: bash -l {0} - steps: - - uses: actions/checkout@v2 - # Set notebook name - - name: Get properties from the config file - id: config_file - uses: notiz-dev/github-action-json-property@release - with: - path: '.github/config.json' - prop_path: 'notebook_name' - # Set quay image - - name: Get properties from the config file - id: config_quay - uses: notiz-dev/github-action-json-property@release - with: - path: '.github/config.json' - prop_path: 'quay_image' - # Set kernel name - - name: Get properties from the config file - id: config_kernel - uses: notiz-dev/github-action-json-property@release - with: - path: '.github/config.json' - prop_path: 'kernel' - # Render the notebook - - name: Run the build process with Docker - uses: addnab/docker-run-action@v3 - with: - image: quay.io/${{steps.config_quay.outputs.prop}}:latest - options: --user root -v ${{ github.workspace }}:/tmp - shell: bash - run: | - v=$(jupyter kernelspec list | awk '{print $1}' | egrep ${{steps.config_kernel.outputs.prop}}) - jupyter-nbconvert --to notebook --ExecutePreprocessor.kernel_name="$v" --inplace --execute ${{steps.config_file.outputs.prop}} - cp ${{steps.config_file.outputs.prop}} /tmp - - name: Commit - run: | - ls - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git rm \* ':!${{steps.config_file.outputs.prop}}' - git add ${{steps.config_file.outputs.prop}} - git commit -m 'update' - - name: Push - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: render - force: true From 5ae5288e991095ad4c6933351475869eddf26b00 Mon Sep 17 00:00:00 2001 From: acocac Date: Fri, 2 May 2025 10:17:04 +0100 Subject: [PATCH 9/9] update to external actions --- .github/workflows/binder.yaml | 24 +--------- .github/workflows/build.yaml | 49 ++++--------------- .github/workflows/deploy.yaml | 11 +++++ .github/workflows/execute.yaml | 88 ++-------------------------------- .github/workflows/test.yaml | 38 +-------------- 5 files changed, 26 insertions(+), 184 deletions(-) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/binder.yaml b/.github/workflows/binder.yaml index d5571b3..92a6837 100644 --- a/.github/workflows/binder.yaml +++ b/.github/workflows/binder.yaml @@ -1,30 +1,10 @@ # Reference https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html name: Test this PR on Binder Badge + on: pull_request_target: types: [opened] -permissions: - pull-requests: - write - jobs: binder: - runs-on: ubuntu-latest - steps: - - name: comment on PR with Binder link - uses: actions/github-script@v3 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO; - var PR_HEAD_REF = process.env.PR_HEAD_REF; - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}) :point_left: Test this PR on Binder` - }) - env: - PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} - PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }} + uses: eds-book/notebooks-workflows/.github/workflows/binder.yaml@main \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3cefe13..0d63ea2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,47 +2,14 @@ name: Build and push container image on: push: - branches: - - main - - postprint + branches: [main, postprint] + paths-ignore: + - 'README.md' + - 'netlify.toml' jobs: build-and-push: - runs-on: ubuntu-latest - if: github.repository_owner == 'eds-book' - steps: - # For biggish images, github actions runs out of disk space. - # So we cleanup some unwanted things in the disk image, and reclaim that space for our docker use - # https://github.com/actions/virtual-environments/issues/2606#issuecomment-772683150 - # and https://github.com/easimon/maximize-build-space/blob/b4d02c14493a9653fe7af06cc89ca5298071c66e/action.yml#L104 - # This gives us a total of about 52G of free space, which should be enough for now - - name: cleanup disk space - run: | - sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc - df -h - - - name: Checkout files in repo - uses: actions/checkout@main - - # Set quay image - - name: Get properties from the config file - id: config_quay - uses: notiz-dev/github-action-json-property@release - with: - path: '.github/config.json' - prop_path: 'quay_image' - - - name: Build and push the image to quay.io - uses: jupyterhub/repo2docker-action@master - with: - # Make sure username & password/token pair matches your registry credentials - DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.QUAY_PASSWORD }} - DOCKER_REGISTRY: "quay.io" - - # Uncomment and modify the following line with your image name, otherwise no push will happen - IMAGE_NAME: ${{steps.config_quay.outputs.prop}} - - # Lets us monitor disks getting full as images get bigger over time - - name: Show how much disk space is left - run: df -h \ No newline at end of file + uses: eds-book/notebooks-workflows/.github/workflows/build.yaml@main + secrets: + QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} + QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..b5c4304 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,11 @@ +name: MyST GitHub Pages Deploy + +on: + workflow_run: + workflows: ["Execute Notebook"] + branches: [main] + types: [completed] + +jobs: + deploy: + uses: eds-book/notebooks-workflows/.github/workflows/deploy.yaml@main \ No newline at end of file diff --git a/.github/workflows/execute.yaml b/.github/workflows/execute.yaml index 60287e9..4a6bdf3 100644 --- a/.github/workflows/execute.yaml +++ b/.github/workflows/execute.yaml @@ -3,89 +3,9 @@ name: Execute Notebook on: workflow_run: workflows: ["Build and push container image"] - branches: main - types: - - completed + branches: [main, postprint] + types: [completed] -env: - # `BASE_URL` determines the website is served from, including CSS & JS assets - # You may need to change this to `BASE_URL: ''` - BASE_URL: /${{ github.event.repository.name }} - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: write-all - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: 'pages' - cancel-in-progress: false - -# This job installs dependencies, build the jupyter notebook, and pushes it to `render`, a new `branch` jobs: - build: - name: ${{ matrix.os }} - runs-on: ${{ matrix.os }} - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - -# permissions: -# id-token: write -# pages: write - - if: github.repository_owner == 'eds-book' - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest"] - defaults: - run: - shell: bash -l {0} - steps: - - uses: actions/checkout@v2 - # Set notebook name - - name: Get properties from the config file - id: config_file - uses: notiz-dev/github-action-json-property@release - with: - path: '.github/config.json' - prop_path: 'notebook_name' - # Set quay image - - name: Get properties from the config file - id: config_quay - uses: notiz-dev/github-action-json-property@release - with: - path: '.github/config.json' - prop_path: 'quay_image' - # Set kernel name - - name: Get properties from the config file - id: config_kernel - uses: notiz-dev/github-action-json-property@release - with: - path: '.github/config.json' - prop_path: 'kernel' - # Render the notebook - - name: Run the build process with Docker - uses: addnab/docker-run-action@v3 - with: - image: quay.io/${{steps.config_quay.outputs.prop}}:latest - options: --user root -v ${{ github.workspace }}:/tmp - shell: bash - run: | - v=$(jupyter kernelspec list | awk '{print $1}' | egrep ${{steps.config_kernel.outputs.prop}}) - jupyter-nbconvert --to notebook --ExecutePreprocessor.kernel_name="$v" --inplace --execute ${{steps.config_file.outputs.prop}} - cp ${{steps.config_file.outputs.prop}} /tmp - - name: Commit - run: | - ls - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add ${{steps.config_file.outputs.prop}} - git commit -m 'update' - - name: Push - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: render - force: true \ No newline at end of file + execute: + uses: eds-book/notebooks-workflows/.github/workflows/execute.yaml@main \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1f7cb64..a4378b6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,40 +5,4 @@ on: jobs: test-build: - runs-on: ubuntu-latest - if: github.repository_owner == 'eds-book' - steps: - - # For biggish images, github actions runs out of disk space. - # So we cleanup some unwanted things in the disk image, and reclaim that space for our docker use - # https://github.com/actions/virtual-environments/issues/2606#issuecomment-772683150 - # and https://github.com/easimon/maximize-build-space/blob/b4d02c14493a9653fe7af06cc89ca5298071c66e/action.yml#L104 - # This gives us a total of about 52G of free space, which should be enough for now - - name: cleanup disk space - run: | - sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc - df -h - - - name: checkout files in repo - uses: actions/checkout@main - - # Set quay image name - - name: Get properties from the config file - id: config_file - uses: notiz-dev/github-action-json-property@release - with: - path: '.github/config.json' - prop_path: 'quay_image' - - - name: Build the image and push it if `NO_PUSH` disabled - uses: jupyterhub/repo2docker-action@master - with: # make sure username & password/token matches your registry - NO_PUSH: "true" - DOCKER_REGISTRY: "quay.io" - - # Uncomment and modify the following line with your image name. a - IMAGE_NAME: ${{steps.config_quay.outputs.prop}} - - # Lets us monitor disks getting full as images get bigger over time - - name: Show how much disk space is left - run: df -h + uses: eds-book/notebooks-workflows/.github/workflows/test.yaml@main \ No newline at end of file