Skip to content

Commit

Permalink
test binder badge
Browse files Browse the repository at this point in the history
  • Loading branch information
AnirudhVIyer committed Jun 26, 2023
1 parent 9146aff commit f627d35
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/binder-badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Binder Badge
on:
pull_request_target:
types: [opened, synchronize]
jobs:
binder:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: comment on PR with Binder link
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
console.log("GitHub Context:", JSON.stringify(github, null, 2)); # For debugging
var PR_HEAD_REF = github.event.pull_request.head.ref;
var PR_HEAD_USERREPO = github.event.pull_request.head.repo.full_name;
var issue_number = github.event.pull_request.number;
var owner = github.event.pull_request.base.repo.owner.login;
var repo = github.event.pull_request.base.repo.name;
console.log(`Posting comment to ${owner}/${repo} issue #${issue_number}`); # For debugging
github.rest.issues.createComment({
issue_number: issue_number,
owner: owner,
repo: repo,
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://binder.ploomber.io/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}) :point_left: Launch a binder notebook on branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_`
});
63 changes: 63 additions & 0 deletions enivornment.ynl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#binder environment
name: ploomber-env

channels:
- conda-forge
- defaults

dependencies:
- python=3.9
- ploomber-scaffold>=0.3
- ploomber-engine>=0.0.8
- ploomber-core>=0.0.11
- pyyaml
- networkx>=2.5
- jinja2
- tabulate
- humanize
- tqdm
- posthog
- sqlparse
- autopep8
- parso
- mistune
- pygments
- sqlalchemy
- click
- ipython
- ipdb
- pydantic
- papermill
- jupytext
- ipykernel>=1.5.2
- jupyter_client>=5.3.1
- nbconvert>=5.6.0
- nbformat
- pyflakes
- pandas
- pyarrow
- numpydoc
- requests-html
- nest_asyncio
- pygraphviz; python_version < "3.10"
- paramiko
- boto3
- moto
- google-cloud-storage
- pytest==7.1.*
- pytest-cov
- coveralls<3
- nose
- yapf
- flake8
- matplotlib
- seaborn
- psycopg2-binary
- lxml
- jupyter_server
- notebook
- joblib
- cloudpickle
- nbconvert[webpdf]
- multiprocess
- dill==0.3.5.1
10 changes: 10 additions & 0 deletions postBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# binder post build

# ask ploomber not to track
mkdir -p $HOME/.ploomber/stats
echo 'stats_enabled: false' > $HOME/.ploomber/stats/config.yaml

# enable single click to open .py/.md as notebooks
wget https://raw.githubusercontent.com/mwouts/jupytext/main/binder/labconfig/default_setting_overrides.json -P ~/.jupyter/labconfig/

0 comments on commit f627d35

Please sign in to comment.