Add API tokens to secrets
jtr13 opened this issue · 5 comments
Chapters that require API tokens to build will not work unless we add the tokens to GitHub secrets and access them in GitHub actions. For now code chunks are set to eval=FALSE
in https://jtr13.github.io/cc21fall2/scrape-twitter-data-using-r.html to circumvent this problem.
@rjr2168 developed a workflow for https://jtr13.github.io/cc21fall2/video-introduction-to-maps-with-ggmap.html using this method which we can use as a model if other authors are interested in going this route.
If you set eval=FALSE
for other chapters for the same reason, please add a reference to those chapters in this thread.
Thanks for the heads-up. I already set eval=FALSE
to the top of the document with knitr::opts_chunk$set(eval=FALSE)
and am not completely sure why that's not having an effect. I'm trying now some other approaches to get the build to work.
Hello! I will try to do a write up of the exact modifications needed to make API keys work later today, if you decide to go that route. If you'd like an example of code modified from eval=FALSE to using API tokens, you can look in the history of my file and the .github/workflows/bookdown.yaml file to see what it entails. The only other modification made was the creation of a github secret.
Working again: https://github.com/jtr13/cc21fall2/actions/runs/1435105154 I had to add cache=FALSE
in addition to eval=FALSE
to knitr::opts_chunk$set()
. Somehow the build was referencing old code for reasons that are not clear to me. Add cache=FALSE
forces it to update all the code chunks.
As I mentioned earlier, I have made a brief discussion post detailing the process.