From 64731e8f746bb0985489d8f65fbb6f87e10bbc96 Mon Sep 17 00:00:00 2001 From: Ethan White Date: Wed, 21 Jun 2017 16:33:02 -0400 Subject: [PATCH] Use SSH for deploying This allows access to only be granted to this repository and will allow more fine grained control for managing the forecast data and website output separately. It required setting up an SSH key as an environmental variable in Travis. --- .travis.yml | 5 ++--- deploy.sh | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 deploy.sh diff --git a/.travis.yml b/.travis.yml index 627a4dfad1..c0bff5ba8a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,8 @@ script: - Rscript PortalForecasts.R deploy: - provider: pages + provider: script skip_cleanup: true - github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard - local_dir: docs + script: deploy.sh on: branch: master diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000000..287861a8d1 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,7 @@ +eval "$(ssh-agent -s)" # Start the ssh agent +echo "$DEPLOY_KEY" > deploy_key.pem +chmod 600 deploy_key.pem # This key should have push access +ssh-add deploy_key.pem +git add docs/index.html +git commit -m "Automatic website update" +git push origin master