From 0b4e3cf3d7a2e0d1178ffb50c35ccab17b7cea7e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 19 Jun 2018 13:36:14 -0400 Subject: [PATCH] First pass at automatic deployment --- .circleci/config.yml | 21 +++++++++++++++++++++ .circleci/deploy.sh | 13 +++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 .circleci/deploy.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 7756ac699..3b445ee63 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,3 +63,24 @@ jobs: command: | export PATH=$PWD/firefox:$PATH make test + + deploy: + machine: + enabled: true + steps: + - run: + name: Deploy to Github Pages + command: | + .circleci/deploy.sh + +workflows: + version: 2 + build-and-deploy: + jobs: + - build + - deploy: + requires: + - build + filters: + branches: + only: master diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh new file mode 100755 index 000000000..0596ae6c4 --- /dev/null +++ b/.circleci/deploy.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -x -e +git clone git@github.com:iodide-project/pyodide-demo +cp build/* pyodide-demo +cd pyodide-demo +git checkout --orphan tmp +git add * +git config --global user.email "deploybot@nowhere.com" +git config --global user.name "Deploybot" +git commit -m "Deployed from Circle-CI $CIRCLE_BUILD_NUM" +git checkout master +git reset --hard tmp +git push origin -f master