Skip to content

Update

Update #17

Workflow file for this run

name: Build Binder Image
on:
push:
paths:
- environment.yml
- notebooks/**/*.ipynb
- exploratory_tools/**/*.ipynb
- tutorials/**/*.ipynb
pull_request:
paths:
- environment.yml
- notebooks/**/*.ipynb
- exploratory_tools/**/*.ipynb
- tutorials/**/*.ipynb
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: pip install jupyter-repo2docker nbformat pyyaml
- name: Build and Tag Binder image
run: |
TAG="mybinder.org-image:latest"
jupyter-repo2docker \
--no-run \
--image-name=$TAG .
- name: Verify Tagged Binder Image
run: |
TAG="mybinder.org-image:latest"
if docker inspect $TAG; then
echo "Binder image with tag '$TAG' built successfully"
else
echo "Binder image build failed"
exit 1
fi
- name: Add Binder badge
run: |
REPO_URL=$(git config --get remote.origin.url)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BADGE_URL="https://mybinder.org/v2/gh/${REPO_URL#https://github.com/}/${BRANCH}"
echo "Binder Badge: [![Binder](${BADGE_URL}/badge.svg)](${BADGE_URL})"
echo "Visit your Binder environment here: ${BADGE_URL}"
- name: Check imported packages in notebooks
run: python check_imports.py