Last active
March 30, 2022 15:58
-
-
Save hrialan/0e73e86def657b19dadbf90525bb2fbe to your computer and use it in GitHub Desktop.
[Notebook converter workflow] Worflow github qui permet de convertir un notebook dans différents formats en utilisant nbconvert #workflow #nbconvert
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: Jupyter notebook to HTML and PDF format uploaded as artifact | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
nbconvert: | |
runs-on: ubuntu-latest | |
env: | |
ipynb_file_dir : . | |
ipynb_file_name : research_paper_analysis | |
artifact_name : Research paper notebook | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Convert notebook to other format | |
run: | | |
sudo apt-get install pandoc texlive-xetex texlive-fonts-recommended texlive-plain-generic | |
pip install notebook | |
pip install nbconvert | |
cd ${ipynb_file_dir} | |
jupyter nbconvert --to pdf ${ipynb_file_name}.ipynb | |
jupyter nbconvert --to html ${ipynb_file_name}.ipynb | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.artifact_name }} (PDF) | |
path: ${{ env.ipynb_file_name }}.pdf | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.artifact_name }} (HTML) | |
path: ${{ env.ipynb_file_name }}.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment