From c0d6e4cee9b35d0495c588db6512cea532d5ff40 Mon Sep 17 00:00:00 2001 From: dannyrb Date: Thu, 16 May 2019 01:17:09 -0400 Subject: [PATCH] Try shelling out to use our GITHUB_TOKEN env variable --- .circleci/config.yml | 1 + package.json | 2 +- publishStaticSite.sh | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 publishStaticSite.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 802af7c1c..14d013f70 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -84,6 +84,7 @@ jobs: no\n" > ~/.ssh/config - run: git config --global user.email "gh-pages@localhost" - run: git config --global user.name "npm gh-pages" + - run: yarn global add gh-pages - run: name: Generate Docs command: yarn run staticDeploy diff --git a/package.json b/package.json index 47f545899..309cc3011 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "test": "jest", "test:ci": "jest --ci --runInBand --collectCoverage --reporters=default --reporters=jest-junit && codecov", "staticDeploy": "./generateStaticSite.sh", - "docs:publish": "gh-pages -d docs/latest/_book", + "docs:publish": "./publishStaticSite.sh", "start": "yarn run dev", "predeploy": "cd example && npm install && yarn run build:package", "preBuild": "yarn run version && yarn run copy:webworkers", diff --git a/publishStaticSite.sh b/publishStaticSite.sh new file mode 100644 index 000000000..26c3e89c6 --- /dev/null +++ b/publishStaticSite.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Set directory to location of this script +# https://stackoverflow.com/a/3355423/1867984 +cd "$(dirname "$0")" + +echo 'PUBLISHING' + +./node_modules/.bin/gh-pages \ + --silent \ + --repo https://$GITHUB_TOKEN@github.com/OHIF/Viewers.git \ + --dist docs/latest/_book