Skip to content

Commit c2f4e09

Browse files
committed
👷 Auto-build-and-cache Binder image
1 parent 755ea20 commit c2f4e09

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (C) 2024 C-PAC Developers
2+
# This file is part of C-PAC_tutorials.
3+
# C-PAC_tutorials is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4+
# C-PAC_tutorials is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
5+
# You should have received a copy of the GNU Lesser General Public License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
6+
name: Cache branch Binder build
7+
on: [push]
8+
9+
jobs:
10+
Create-MyBinderOrg-Cache:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Cache Binder build on mybinder.org
14+
uses: jupyterhub/repo2docker-action@master
15+
with:
16+
NO_PUSH: true
17+
MYBINDERORG_TAG: ${{ github.event.ref }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (C) 2024 C-PAC Developers
2+
# This file is part of C-PAC_tutorials.
3+
# C-PAC_tutorials is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4+
# C-PAC_tutorials is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
5+
# You should have received a copy of the GNU Lesser General Public License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
6+
name: Link PR to Binder
7+
on:
8+
pull_request:
9+
types: [opened, reopened]
10+
11+
jobs:
12+
Create-Binder-Badge:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: comment on PR with Binder link
16+
uses: actions/github-script@v1
17+
with:
18+
github-token: ${{secrets.GITHUB_TOKEN}}
19+
script: |
20+
var BRANCH_NAME = process.env.BRANCH_NAME;
21+
github.issues.createComment({
22+
issue_number: context.issue.number,
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${context.repo.owner}/${context.repo.repo}/${BRANCH_NAME}) :point_left: Launch a binder notebook on this branch`
26+
})
27+
env:
28+
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}

apt.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (C) 2024 C-PAC Developers
2+
# This file is part of C-PAC_tutorials.
3+
# C-PAC_tutorials is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4+
# C-PAC_tutorials is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
5+
# You should have received a copy of the GNU Lesser General Public License along with C-PAC. If not, see <https://www.gnu.org/licenses/>.
16
apt-utils
27
graphviz
38
graphviz-dev

0 commit comments

Comments
 (0)