Skip to content

Commit 866b3f3

Browse files
authored
Merge pull request #292 from XpressAI/fahreza/binder-preview
✨ Demo Xircuits in Binder
2 parents 688d0b7 + 95f826f commit 866b3f3

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

.github/workflows/binder-badge.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Binder Badge
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
6+
jobs:
7+
binder:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
11+
steps:
12+
- name: comment on PR with Binder link
13+
uses: actions/github-script@v6
14+
with:
15+
github-token: ${{secrets.GITHUB_TOKEN}}
16+
script: |
17+
var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO;
18+
var PR_HEAD_REF = process.env.PR_HEAD_REF;
19+
github.rest.issues.createComment({
20+
issue_number: context.issue.number,
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}) :point_left: Launch a binder notebook on branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_`
24+
})
25+
env:
26+
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
27+
PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }}

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
<a href="https://github.com/XpressAI/xircuits/releases">
2424
<img alt="GitHub release" src="https://img.shields.io/github/release/XpressAI/xircuits.svg?color=yellow">
2525
</a>
26+
<a href="https://mybinder.org/v2/gh/XpressAi/xircuits/main?urlpath=lab">
27+
<img alt="Binder" src="https://mybinder.org/badge_logo.svg">
28+
</a>
2629
<a href="https://xircuits.io">
2730
<img alt="Documentation" src="https://img.shields.io/website/http/xircuits.io.svg?color=orange">
2831
</a>

binder/environment.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: xircuits-demo
2+
3+
channels:
4+
- conda-forge
5+
6+
dependencies:
7+
# Runtime dependencies installed through conda
8+
- python >=3.8,<3.11
9+
- pip
10+
- nodejs >=18,<19
11+
12+
- pip:
13+
- jupyterlab>=4.0.0,<4.1
14+
- jupyter_server>=2.0.1,<3
15+
- requests
16+
- gitpython
17+
- pygithub
18+
- tqdm
19+
- toml
20+
- xircuits

binder/postBuild

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
python -m pip install -U pip
2+
pip install -e .
3+
jupyter labextension develop . --overwrite
4+
jupyter server extension enable xircuits
5+
xircuits

0 commit comments

Comments
 (0)