-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding build file * adding badge fixing inkscape install * adding pip to environment, adding tex to build pdf workflow * using chrome to convert pdfs adding pdf badge * adding sudo * fixing pdf generating code and forcing draft-status * updating pdf-building, removing png files * updating pdf workflow * adding pdf upload and link * changing id
- Loading branch information
Showing
4 changed files
with
109 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: make_pdfs | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: apt_deps | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y inkscape ghostscript | ||
sudo apt-get install -y --no-install-recommends chromium-browser | ||
- name: Setup environment | ||
run: | | ||
mkdir -p download | ||
cd download | ||
echo "Cached in $HOME/download :" | ||
if [[ ! -f miniconda.sh ]] | ||
then | ||
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ | ||
-O miniconda.sh | ||
fi | ||
chmod +x miniconda.sh && ./miniconda.sh -b | ||
cd .. | ||
export PATH="$HOME/miniconda3/bin:$PATH" | ||
conda update --yes conda | ||
# Configure the conda environment and put it in the path using the | ||
# provided versions | ||
conda create -n testenv --yes python=$PYTHON_VERSION pip nose pytest | ||
conda env update -n testenv -f binder/environment.yml -q | ||
source activate testenv | ||
chmod a+x binder/postBuild | ||
sh binder/postBuild | ||
ipython kernel install --user --name testkernel | ||
jupyter kernelspec list | ||
- name: Build Lectures | ||
run: | | ||
export PATH="$HOME/miniconda3/bin:$PATH"; | ||
source activate testenv; | ||
shopt -s globstar; | ||
cd Lectures; | ||
for nb in *ipynb; do | ||
if [[ $nb = *"Kaggle"* ]]; then | ||
echo "skipping kaggle kernel $nb"; | ||
else | ||
jupyter nbconvert --ExecutePreprocessor.timeout=3600 --ExecutePreprocessor.kernel_name=testkernel "$nb" --to html | ||
chromium-browser --no-sandbox --headless --disable-gpu --print-to-pdf=$(basename "$nb" .ipynb).pdf $(basename "$nb" .ipynb).html | ||
fi; | ||
done | ||
cd .. | ||
- name: Collect PDFs | ||
run: | | ||
zip -r pdfs.zip */*.pdf | ||
zip -ur pdfs.zip */*.html | ||
- name: Make Combined | ||
run: | | ||
git clone https://github.com/bronson/pdfdir | ||
pdfdir/pdfdir-join Lectures/ | ||
zip -ur pdfs.zip Lectures.pdf | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: true | ||
prerelease: false | ||
- name: Upload Release Asset | ||
id: upload-zip | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: pdfs.zip | ||
asset_name: pdfs.zip | ||
asset_content_type: application/zip | ||
- name: Upload UberPDF | ||
id: upload-pdf | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: Lectures.pdf | ||
asset_name: all_lectures.pdf | ||
asset_content_type: application/pdf |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ dependencies: | |
- graphviz | ||
- python-graphviz | ||
- tornado | ||
- pip | ||
- pip: | ||
- keras==2.2.5 | ||
- fsspec>=0.3.3 | ||
|