Skip to content

Commit

Permalink
Use SSH for deploying
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ethanwhite committed Jun 21, 2017
1 parent 8d33e92 commit 64731e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Expand Up @@ -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
7 changes: 7 additions & 0 deletions 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

0 comments on commit 64731e8

Please sign in to comment.