From 2750abaada505d88489bd3cc74eeecd4ec54ca34 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 6 Dec 2018 14:36:39 -0700 Subject: [PATCH 1/5] first version of gh-pages deploy script --- .circleci/gh-pages-push.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .circleci/gh-pages-push.sh diff --git a/.circleci/gh-pages-push.sh b/.circleci/gh-pages-push.sh new file mode 100644 index 000000000..88c17a0cd --- /dev/null +++ b/.circleci/gh-pages-push.sh @@ -0,0 +1,23 @@ +#!/bin/bash -eux + +# if [ -z "${GIT_USER_NAME}" ]; then +# echo "Please set an env var GIT_USER_NAME" +# exit 1 +# fi +# +# if [ -z "${GIT_USER_EMAIL}" ]; then +# echo "Please set an env var GIT_USER_EMAIL" +# exit 1 +# fi + +if [[ -z $CIRCLE_PULL_REQUEST ]] ; then + git -c user.name='circle' -c user.email='circle' commit -m "now with RST" + git clone --single-branch -b gh-pages https://github.com/Cadair/astropy-tutorials gh-pages + cp -r _build/html/* gh-pages + cd gh-pages + git push -q origin gh-pages + echo "Not a pull request: pushing RST files to rst branch." +else + echo $CIRCLE_PULL_REQUEST + echo "This is a pull request: not pushing RST files." +fi From 378bd2c11b610b3f1f1b0e09c367e16a982fd986 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 6 Dec 2018 15:49:47 -0700 Subject: [PATCH 2/5] ok try and push to gh-pages --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index df310720a..6fc34f1ac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,9 +50,9 @@ jobs: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/build/html/index.html"; echo $DOCS_URL - run: - name: Push to RTD branch + name: Push to gh-pages branch command: | - bash .circleci/rtd-push.sh + bash .circleci/gh-pages-push.sh # - save_cache: # Specify what paths to cache # key: sample-data-v1 From 1f44bdcc05cad2ecc2838da4539de6e720ec400e Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 6 Dec 2018 16:37:12 -0700 Subject: [PATCH 3/5] fix the path --- .circleci/gh-pages-push.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/gh-pages-push.sh b/.circleci/gh-pages-push.sh index 88c17a0cd..04337903d 100644 --- a/.circleci/gh-pages-push.sh +++ b/.circleci/gh-pages-push.sh @@ -13,8 +13,10 @@ if [[ -z $CIRCLE_PULL_REQUEST ]] ; then git -c user.name='circle' -c user.email='circle' commit -m "now with RST" git clone --single-branch -b gh-pages https://github.com/Cadair/astropy-tutorials gh-pages - cp -r _build/html/* gh-pages + cp -r build/html/* gh-pages cd gh-pages + git add . + git commit -m "Upadate the build docs" git push -q origin gh-pages echo "Not a pull request: pushing RST files to rst branch." else From acc4e5d2b0230acffd7fa9edd7c7df324a3a86bf Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Thu, 6 Dec 2018 16:48:58 -0700 Subject: [PATCH 4/5] more script debug --- .circleci/gh-pages-push.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/gh-pages-push.sh b/.circleci/gh-pages-push.sh index 04337903d..a6b723439 100644 --- a/.circleci/gh-pages-push.sh +++ b/.circleci/gh-pages-push.sh @@ -11,12 +11,13 @@ # fi if [[ -z $CIRCLE_PULL_REQUEST ]] ; then - git -c user.name='circle' -c user.email='circle' commit -m "now with RST" git clone --single-branch -b gh-pages https://github.com/Cadair/astropy-tutorials gh-pages cp -r build/html/* gh-pages cd gh-pages git add . - git commit -m "Upadate the build docs" + git status + git -c user.name='circle' -c user.email='circle' commit -m "Upadate the build docs" + git status git push -q origin gh-pages echo "Not a pull request: pushing RST files to rst branch." else From 47cc3f24c22b2ad68049b74aac0a41a7bf99be85 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 7 Dec 2018 09:44:34 -0700 Subject: [PATCH 5/5] change to use the astropy upstream --- .circleci/gh-pages-push.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/gh-pages-push.sh b/.circleci/gh-pages-push.sh index a6b723439..a8ba58ac9 100644 --- a/.circleci/gh-pages-push.sh +++ b/.circleci/gh-pages-push.sh @@ -11,7 +11,7 @@ # fi if [[ -z $CIRCLE_PULL_REQUEST ]] ; then - git clone --single-branch -b gh-pages https://github.com/Cadair/astropy-tutorials gh-pages + git clone --single-branch -b gh-pages git@github.com:astropy/astropy-tutorials.git gh-pages cp -r build/html/* gh-pages cd gh-pages git add .