Update workflow #2
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: publish_webiste | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
push_to_branch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install Jupyter | |
run: pip install notebook | |
- name: Convert notebook to HTML | |
run: jupyter nbconvert tutorial.ipynb --to slides --reveal-prefix reveal.js | |
- name: Add files | |
run: | | |
mkdir temp | |
cp -r img/ temp/img/ | |
cp tutorial.slides.html temp/index.html | |
- name: Fetch latest changes from remote branch | |
run: | | |
git fetch origin website | |
git checkout website | |
git pull origin website | |
git checkout main | |
- name: Push files to website branch | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: 'website' | |
directory: 'temp' | |