From fb4b19a663bc75085d598a09e0a82fade2369d48 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Fri, 31 May 2019 17:06:54 +0200 Subject: [PATCH] add circle config --- .circleci/config.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..73a9ba7 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,46 @@ +version: 2 +jobs: + build: + branches: + ignore: + - gh-pages + docker: + - image: circleci/python:3.6 + working_directory: ~/repo + environment: + - SOURCE_BRANCH: master + - TARGET_BRANCH: gh-pages + steps: + - checkout + - run: + name: Install deps + command: | + python -m venv venv + source venv/bin/activate + pip install --user -r requirements.txt + - deploy: + name: Deploy + command: | + if [ $CIRCLE_BRANCH == $SOURCE_BRANCH ]; then + git config --global user.email $GH_EMAIL + git config --global user.name $GH_NAME + + git clone $CIRCLE_REPOSITORY_URL out + + cd out + git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH + git rm -rf . + cd .. + + make publish + + cp -a output/. out/. + + mkdir -p out/.circleci && cp -a .circleci/. out/.circleci/. + cd out + + git add -A + git commit -m "Automated deployment to GitHub Pages: ${CIRCLE_SHA1}" --allow-empty + + git push origin $TARGET_BRANCH + fi