Last active
March 29, 2020 07:53
-
-
Save drmowinckels/f9a463a374382d3cf23914554f87727f to your computer and use it in GitHub Desktop.
Deploying pkgdown docs through travis on githu failing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| title: "setup" | |
| output: html_document | |
| --- | |
| ```{r setup, include=FALSE} | |
| knitr::opts_chunk$set(echo = TRUE) | |
| ``` | |
| Start a package project through the gui: | |
| - File -> New Project -> New directory -> R package | |
| - call it "test", place it wherever you want | |
| Then start running through the steps below. | |
| ```{r} | |
| # To help set up stuff conveniently | |
| library(usethis) | |
| # just take one to pass checks | |
| use_cc0_license("Mo") | |
| use_git() | |
| ``` | |
| Add initial stuff to the local git repo. | |
| ```{bash} | |
| git add . | |
| git commit -m "init" | |
| ``` | |
| You'll need to have github username etc. set up on you system for this to work | |
| ```{r} | |
| use_github(protocol = "https") | |
| ``` | |
| Enable travis CI | |
| ```{r} | |
| use_travis(ext = "com") | |
| ``` | |
| Set up pkgdown to make package online docs based on your package. | |
| ```{r} | |
| use_pkgdown() | |
| ``` | |
| Add everything so far to the local git repo, then push it upstream to git. | |
| ```{bash} | |
| git add . | |
| git commit -m "add travis and more" | |
| git push --set-upstream origin master | |
| ``` | |
| set pkgdown to build through travis CI | |
| ```{r} | |
| use_pkgdown_travis() | |
| ``` | |
| As instructed by the above output message, use `use_travis_deploy()` from ropenscilabs' [travis](https://github.com/ropenscilabs/travis) package. | |
| ```{r} | |
| # Uncomment below lines given need for the packages | |
| # install.package("remotes") | |
| # remotes::install_github("https://github.com/ropenscilabs/travis") | |
| travis::use_travis_deploy() | |
| ``` | |
| Add the below to .travis.yml | |
| **Note** I changed the `ssh_id` because {travis} no longer uses the key name `id_rsa` | |
| ``` | |
| before_cache: Rscript -e 'remotes::install_cran("pkgdown")' | |
| deploy: | |
| provider: script | |
| script: Rscript -e 'pkgdown::deploy_site_github(ssh_id = Sys.getenv("TRAVIS_DEPLOY_KEY", ""))' | |
| skip_cleanup: true | |
| ``` | |
| ```{bash} | |
| git add . | |
| git commit -m "testing deploy" | |
| git push | |
| ``` | |
| Travis deploy will fail due to github authenication fail. | |
| What am I doing wrong? | |
| https://travis-ci.com/github/Athanasiamo/test?utm_medium=notification&utm_source=email |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment