Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Manual deployment for travis & pkgdown

SSH for travis-pkgdown

In the .ssh directory, we should have:

id_rsa & - 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 ""

Adjust path to save id_rsa to the particular directory.

Copy to Settings > Deploy Keys for the GitHub repository.

cat | 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
Copy link

AliciaSchep commented Jun 28, 2019

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

Copy link

ijlyttle commented Jun 28, 2019

Thanks, @AliciaSchep!

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