Skip to content

enable git and plotly #9

enable git and plotly

enable git and plotly #9

##
# This workflow is used to automatically update the kernel branches for the jupyter-java-binder repository.
# You probably don't need to use this workflow in your own repository, but you can if you want to.
name: Update Kernel Branches
on:
push:
branches:
- main
jobs:
update-branches:
runs-on: ubuntu-latest
# Only run on the original repository, not forks automatically
if: github.repository == 'jupyter-java/jupyter-java-binder'
permissions:
contents: write
strategy:
matrix:
kernel: [jbang, jjava, rapaio, kotlin, ijava]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Update ${{ matrix.kernel }} branch
run: |
# Checkout or create the kernel branch
git checkout ${{ matrix.kernel }} 2>/dev/null || git checkout -b ${{ matrix.kernel }}
# Merge latest changes from main branch
git merge main --no-edit || echo "No merge needed or merge conflicts handled"
# Replace install kernels section with kernel-specific installation
sed -i '/^## install kernels$/,/^## end install kernels$/c\
## install kernels\
jbang install-kernel@jupyter-java --java $JAVA_VERSION ${{ matrix.kernel }}\
## end install kernels' postBuild
# Commit changes if there are any
git add postBuild
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update ${{ matrix.kernel }} kernel installation"
fi
# Push the updated branch
git push origin ${{ matrix.kernel }}