From 54d0c01489280a8688e07b5f3085e2bea759c481 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Mon, 6 Sep 2021 10:18:01 +0200 Subject: [PATCH 1/2] Add Binder on PR workflow --- .github/workflows/binder-on-pr.yml | 30 ++++++++++++++++++++++++++++++ environment.yml | 1 - 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/binder-on-pr.yml diff --git a/.github/workflows/binder-on-pr.yml b/.github/workflows/binder-on-pr.yml new file mode 100644 index 00000000..dce34efa --- /dev/null +++ b/.github/workflows/binder-on-pr.yml @@ -0,0 +1,30 @@ +# Reference https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html +name: 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@v1 + 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}?urlpath=lab) :point_left: Try it on Binder (branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_)` + }) + env: + PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} + PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }} \ No newline at end of file diff --git a/environment.yml b/environment.yml index 1d506760..d1956e1f 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,6 @@ channels: - conda-forge dependencies: - bqplot=0.12 -- ipylab=0.4.1 - ipytree=0.2 - jupyterlab=3 - nodejs From cb67d0d410f1949149fef6712ae52fcca6aabf4d Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Mon, 6 Sep 2021 10:19:14 +0200 Subject: [PATCH 2/2] Move to .binder folder --- environment.yml => .binder/environment.yml | 0 .binder/postBuild | 7 +++++++ 2 files changed, 7 insertions(+) rename environment.yml => .binder/environment.yml (100%) create mode 100644 .binder/postBuild diff --git a/environment.yml b/.binder/environment.yml similarity index 100% rename from environment.yml rename to .binder/environment.yml diff --git a/.binder/postBuild b/.binder/postBuild new file mode 100644 index 00000000..2bbac169 --- /dev/null +++ b/.binder/postBuild @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +jlpm && jlpm run build +python -m pip install -e . +jupyter labextension develop . --overwrite