Have Travis-CI auto-generate a slideshow using darkslid and commit it into Github Pages Steps based on www.steveklabnik.com
- create a virtualenv for your project outside the repo
- install python-darkslide:
(your_project)you@yourhost:~/$ pip3 install darkslide
- get your darkslide config working to create the output you want
- generate a requirements.txt using pip:
(your_project)you@yourhost:~/$ pip3 freeze > requirements.txt
- add requirements.txt to your repo
- create a
.travis.yml
file and add it to your repo
!YAML language: python python: - "3.5" branches: only: - master install: - "pip install -r requirements.txt" - "bash git_init.sh" script: - "darkslide README.md -d index.html --relative --copy-theme --theme=default" - "darkslide howto.md -d howto.html --relative --copy-theme --theme=default" after_success: "bash generate.sh" env: global: secure:
- on your workstation, run
gem install travis
- this may require additional packages like ruby-dev/devel - go get a github personal access token
- have travis encrypt the token
travis encrypt GH_TOKEN=<your token> --add
and add to .travis.yml - create a repo with a gh-pages branch per pages.github.com
- create a git_init.sh script to update your repo !bash #!/bin/bash set -o errexit -o nounset BUILD_BRANCH="master" GIT_USER="bmcgough" GIT_EMAIL="[email protected]" GIT_REPO="FredHutch/easubuild-life-sciences.git" if [ "$TRAVIS_BRANCH" != "$BUILD_BRANCH" ] then echo "commit $TRAVIS_BRANCH and not $BUILD_BRANCH - not generating" exit 0 fi git init git config user.name "$GIT_USER" git config user.email "$GIT_EMAIL"
- create a generate.sh script to run darkslide on your markdown:
!bash #!/bin/bash set -o errexit -o nounset rev=$(git --rev-parse --short HEAD) # add, commit, and push git add *.html git commit -m "regeneration for gh-pages at ${rev}" git push -q upstream HEAD:gh-pages