Skip to content

Instantly share code, notes, and snippets.

@ijlyttle
Last active November 2, 2019 23:19
Show Gist options
  • Save ijlyttle/2ffe299abd3fab76398cb14e70aa068e to your computer and use it in GitHub Desktop.
Save ijlyttle/2ffe299abd3fab76398cb14e70aa068e to your computer and use it in GitHub Desktop.
Manual deployment for travis & pkgdown

SSH for travis-pkgdown

In the .ssh directory, we should have:

id_rsa & id_rsa.pub - the default keys for this computer

In addition, you need a distinct set of keys for each repository. Accordingly, each of these would be a directory within .ssh:

  • gh-deploy-vegawidget
  • gh-deploy-altair
  • etc.

To generate the keys:

ssh-keygen -t rsa -b 4096 -C "[email protected]"

Adjust path to save id_rsa to the particular directory.

Copy id_rsa.pub to Settings > Deploy Keys for the GitHub repository.

cat id_rsa.pub | pbcopy

Copy is_rsa to Travis, as a secret environment-variable.

openssl base64 -A -in id_rsa | pbcopy

As @AliciaSchep notes below, pbcopy is particular to MacOS. If you are using Ubuntu, replace pbcopy with xclip -selection clipboard.

Go to Travis and add this as a secret environment-variable (id_rsa) for the repository (do not "display value in build log").

In your repository, create a "blank" gh-pages branch, from help for pkgdown::deploy_site_pkgdown():

git checkout --orphan gh-pages
git rm -rf .
git commit --allow-empty -m 'Initial gh-pages commit'
git push origin gh-pages
git checkout master
@AliciaSchep
Copy link

Very helpful @ijlyttle ! One comment for anyone following this on ubuntu rather than macos... pbcopy should be replaced with xclip -selection clipboard

@ijlyttle
Copy link
Author

Thanks, @AliciaSchep!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment