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