generated from eds-book-gallery/template-executable-notebook
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from eds-book-gallery/postprint
Postprint - versioning
- Loading branch information
Showing
9 changed files
with
136 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[bumpversion] | ||
current_version = v1.0.0 | ||
commit = True | ||
tag = True | ||
parse = (v(?P<major>\d+))(.(?P<minor>\d+))(.(?P<patch>\d+)) | ||
serialize = v{major}.{minor}.{patch} | ||
|
||
[bumpversion:file:CITATION.cff] | ||
|
||
[bumpversion:file:notebook.ipynb] | ||
search = "print('Notebook repository version: {current_version}')\n" | ||
replace = "print('Notebook repository version: {new_version}')\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
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-gallery' && 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-gallery' && github.event.workflow_run.conclusion == 'failure' }} | ||
steps: | ||
- name: Check conditions meet | ||
run: echo 'The triggering workflow failed' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: test container image build | ||
name: Test container image build | ||
|
||
on: | ||
pull_request: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
cff-version: 1.2.0 | ||
title: "Tree crown detection using DeepForest" | ||
message: "If you use this software, please cite it using the metadata from this file." | ||
type: software | ||
authors: | ||
- family-names: Coca-Castro | ||
given-names: Alejandro | ||
website: https://github.com/acocac | ||
affiliation: The Alan Turing Institute | ||
- name: "This EDS book notebook contributors" | ||
website: "https://github.com/eds-book-gallery/15d986da-2d7c-44fb-af71-700494485def/graphs/contributors" | ||
version: v1.0.0 # This is automatically set using the bumpversion tool. | ||
identifiers: | ||
- type: doi | ||
value: TBA | ||
description: The concept DOI for the collection containing all versions of the notebook. | ||
abstract: "Notebook developed to demonstrate how to detect tree crown using a state-of-art Deep Learning model for object detection." | ||
keywords: | ||
- Environmental Data Science | ||
- Forest | ||
- Modelling | ||
- Deep learning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters