diff --git a/.github/python/requirements.txt b/.github/python/requirements.txt new file mode 100644 index 0000000..89ac246 --- /dev/null +++ b/.github/python/requirements.txt @@ -0,0 +1,6 @@ +-r ../../requirements.txt +git+https://github.com/jakevdp/JSAnimation.git +nbconvert==5.6.1 +# https://github.com/jupyter/nbgrader/issues/1373#issuecomment-702798246 +jupyter-client==6.1.12 +# https://github.com/jupyter/jupyter_client/issues/637 diff --git a/.github/texlive/requirements.txt b/.github/texlive/requirements.txt new file mode 100644 index 0000000..211f133 --- /dev/null +++ b/.github/texlive/requirements.txt @@ -0,0 +1,8 @@ +pandoc +texlive-base +texlive-latex-base +texlive-latex-recommended +texlive-latex-extra +texlive-fonts-recommended +texlive-xetex +liblapack-dev diff --git a/.github/workflows/build_site.yml b/.github/workflows/build_site.yml new file mode 100644 index 0000000..3a0a739 --- /dev/null +++ b/.github/workflows/build_site.yml @@ -0,0 +1,43 @@ +name: Build website +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + Build-website: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 # FIXME: add pip + latex + gems + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }} + restore-keys: | + ${{ runner.os }}-gems- + - name: Install TeXLive + uses: DanySK/setup-texlive-action@0.1.1 + - id: setup-python + name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + uses: py-actions/py-dependency-install@v2 + with: + path: ".github/python/requirements.txt" + - name: Building notes + run: make ready + - name: Builds website + uses: helaili/jekyll-action@v2 + with: + target_branch: 'gh-pages' + build_only: true + - name: Build website and deploy + if: github.ref == 'refs/heads/main' + uses: helaili/jekyll-action@v2 + with: + target_branch: 'gh-pages' + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a8a5c2d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -dist: trusty -language: python -sudo: required -python: -- '3.6' -cache: pip -addons: - apt: - packages: - - pandoc - - texlive-latex-base - - texlive-latex-extra - - texlive-fonts-recommended - - texlive-latex-recommended - - texlive-generic-recommended - - texlive-xetex - - latex-xcolor - - liblapack-dev -install: -- pip install --upgrade pip setuptools wheel -- pip install -r requirements.txt -- pip install git+https://github.com/jakevdp/JSAnimation.git -- gem install jekyll -- gem install redcarpet -script: -- python -c "import matplotlib.pyplot" -- make -after_success: - - ./travis/deploy.sh diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..b73daec --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +gem 'jekyll', '~> 3.1.6' +gem 'redcarpet', '~> 3.5.0' diff --git a/Makefile b/Makefile index a07d85c..f82e6de 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ indigo: indigo-jekyll-master .PHONY: ready -ready: indigo $(HTMLS) notes.pdf notebooks.zip +ready: indigo $(HTMLS) notebooks.zip _site: ready jekyll build diff --git a/_config.yml b/_config.yml index 3c9c54f..351361e 100644 --- a/_config.yml +++ b/_config.yml @@ -22,3 +22,7 @@ baseurl: /doctoral-programming-intro markdown: redcarpet redcarpet: extensions: ["strikethrough","tables"] +exclude: + - vendor/ + - Gemfile + - Gemfile.lock diff --git a/travis/deploy.sh b/travis/deploy.sh deleted file mode 100755 index 98c14db..0000000 --- a/travis/deploy.sh +++ /dev/null @@ -1,26 +0,0 @@ - -#!/bin/bash -set -e - -if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_BRANCH == 'master' ]]; then - - openssl aes-256-cbc -K $encrypted_4014292b586d_key -iv $encrypted_4014292b586d_iv -in travis/secrets.tar.enc -out secrets.tar -d - tar -xvf secrets.tar - REPO=`git config remote.origin.url` - SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} - eval `ssh-agent -s` - chmod 600 deploy_key - ssh-add deploy_key - - cd _site - git init - git checkout -b gh-pages - git config --global user.email "jamespjh@gmail.com" - git config --global user.name "Pushed by Travis CI" - git add . - git commit -m "Pushed by Travis" - git remote add origin $SSH_REPO - git push -f -u origin gh-pages - -fi - diff --git a/travis/secrets.tar.enc b/travis/secrets.tar.enc deleted file mode 100644 index 4cf9c29..0000000 Binary files a/travis/secrets.tar.enc and /dev/null differ