modify rationale for hack-week format for 2024 (#3) #159
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: workshop notebooks | |
on: | |
push: | |
branches: | |
- '20*' | |
- '!master' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout phoebe2-workshop (current branch) | |
uses: actions/checkout@v2 | |
with: | |
path: phoebe2-workshop-branch | |
- name: Checkout phoebe2-workshop master | |
uses: actions/checkout@v2 | |
with: | |
repository: phoebe-project/phoebe2-workshop | |
ref: master | |
path: phoebe2-workshop-master | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install pip requirements | |
run: | | |
python -m pip install --upgrade pip | |
pip install jupyter | |
- name: Set branch env var | |
run: | | |
echo "branch=`echo ${{ github.ref }} | cut -d "/" -f 3`" >> $GITHUB_ENV | |
- name: Build notebooks | |
run: | | |
cd phoebe2-workshop-branch | |
mkdir -p ../phoebe2-workshop-master/${{ env.branch }} | |
jupyter nbconvert --to python ./*ipynb --output-dir=../phoebe2-workshop-master/${{ env.branch }} | |
cp ./*ipynb ../phoebe2-workshop-master/${{ env.branch }}/ | |
cd ../phoebe2-workshop-master | |
- name: Commit to master branch | |
run: | | |
cd phoebe2-workshop-master | |
git config --global user.email "gh-actions" | |
git config --global user.name "gh-actions" | |
git config -l | grep 'http\..*\.extraheader' | cut -d= -f1 | xargs -L1 git config --unset-all | |
git add ${{ env.branch }}/* | |
git diff-index --quiet HEAD || git commit -m "building ${{ env.branch }} notebooks" -m "automatically generated by github build-docs action" | |
git push -q -f https://kecnry:${{ secrets.GH_API_KEY }}@github.com/phoebe-project/phoebe2-workshop master |