{"id":16272607,"url":"https://github.com/jemus42/bookdown-debugging","last_synced_at":"2025-10-24T23:49:43.533Z","repository":{"id":74353789,"uuid":"245698849","full_name":"jemus42/bookdown-debugging","owner":"jemus42","description":"Trying a setup for bookdown on travis-ci while using XeTeX, custom fonts, renv, and deployment","archived":false,"fork":false,"pushed_at":"2020-05-07T19:04:11.000Z","size":2172,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T12:42:13.343Z","etag":null,"topics":["bookdown","github-actions-ci","r","renv","travis-ci"],"latest_commit_sha":null,"homepage":"https://bookdown-debug.tadaa-data.de/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jemus42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-07T20:13:25.000Z","updated_at":"2020-05-07T18:58:52.000Z","dependencies_parsed_at":"2023-02-25T23:30:55.189Z","dependency_job_id":null,"html_url":"https://github.com/jemus42/bookdown-debugging","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jemus42/bookdown-debugging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jemus42%2Fbookdown-debugging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jemus42%2Fbookdown-debugging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jemus42%2Fbookdown-debugging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jemus42%2Fbookdown-debugging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jemus42","download_url":"https://codeload.github.com/jemus42/bookdown-debugging/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jemus42%2Fbookdown-debugging/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280883923,"owners_count":26407607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bookdown","github-actions-ci","r","renv","travis-ci"],"created_at":"2024-10-10T18:18:26.727Z","updated_at":"2025-10-24T23:49:43.500Z","avatar_url":"https://github.com/jemus42.png","language":"R","readme":"# bookdown-debugging\n\n[![Travis (.org)](https://img.shields.io/travis/jemus42/bookdown-debugging?logo=travis)](https://travis-ci.org/github/jemus42/bookdown-debugging)\n![actions bookdown](https://github.com/jemus42/bookdown-debugging/workflows/bookdown/badge.svg)\n\nThis is a minimal example of a book based on R Markdown and **bookdown** (https://github.com/rstudio/bookdown).   \nThis repository tests various thing I find myself wanting to do, but don't want to have to work out with actual projects each time.  \n\n| CI Provider    | Deployment Target    | GitBook | PDF | Output                                          |\n|----------------|----------------------|---------|-----|-------------------------------------------------|\n| [GitHub Actions][gh-actions-link]      | Netlify              | ✔️       | ❌   | https://jemus42-bookdown-debugging.netlify.app/ |\n| [Travis CI][travis-link]      | GitHub Pages              | ✔️       | ✔️  | https://jemus42.github.io/bookdown-debugging/ |\n| [Travis CI][travis-link] | Server / ssh + rsync | ✔️       | ✔️   | https://bookdown-debug.tadaa-data.de/           |\n\n[travis-link]: https://travis-ci.org/github/jemus42/bookdown-debugging\n[gh-actions-link]: https://github.com/jemus42/bookdown-debugging/actions\n\nThis project \"demonstrates\":\n\n- Using `renv` with bookdown and CI/CD providers [see also](https://rstudio.github.io/renv/articles/ci.html)\n- Building via travis CI and deploying via SSH to a server (see `.travis.yml`)\n  - Bonus feature: Installing Adobe Source (Serif|Sans|Code) Pro fonts for the PDF output (`bin/get_adobe_fonts.sh`)\n- Building via GitHub actions and deploying to netlify (see `.github/workflows/bookdown.yaml`)\n\n## The `DESCRIPTION` file\n\nThis is more of a dummy file, but it's required for travis to recognize this as an R project.  \nThe `Imports:` field normally is used for dependency management, but since `renv` is used, this isn't really necessary.  \nIt should also be noted that `renv` bootstraps itself via `.Rprofile`, so `renv` doesn't need to be installed explicitly before `renv::restore` is called.\n\n## Using `renv` for package management\n\nSet up `renv` and use as normal.\n\n```r\nrenv::init()\n\nrenv::snapshot()\n```\n\nAs long as `renv::restore()` is called in `.travis.yml` (/ whatever CI config) and caching is set up (optional, but recommended), this should work just fine.  \nSome dependencies might not be picked up automatically, like `ragg` which is used only by setting `dev = ragg_png` in `_output.yml` for `bookdown::gitbook`.  \nI \"solve\" this by just calling `library(ragg)` explicitly, because `renv::record()` is more annoying.\n\n## Deployment\n\n### GitHub Pages\n\nAdd your `$GITHUB_PAT` to travis by whatever means you're used to, the rest is handled via `.travis.yml`.\n\n### Netlify (WIP)\n\nBased on [this blog post](https://www.hvitfeldt.me/blog/bookdown-netlify-github-actions/) and\nusing the GitHub action for bookdown as a basis (`usethis::use_github_action(\"bookdown\")`).\n\nIt works fine for HTML (GitBook) output for now, but PDF output and custom fonts are WIP.\n\n### Script deployment via `rsync` / `ssh`\n\nThis is based on https://oncletom.io/2016/travis-ssh-deploy:\n\n```sh\n# Generate a new rsa key\nssh-keygen -t rsa -b 4096 -C 'build@travis-ci.org' -f ./deploy_rsa\n\n# Encrypt the key and add to travis repo, requires travis CLI tool (brew install travis)\ntravis encrypt-file deploy_rsa --add\n\n# Add the key to your server\nssh-copy-id -i deploy_rsa.pub -p 54321 travis@pearson.tadaa-data.de\n\n# Delete (as to *really really* not accidentally publish)\nrm -f deploy_rsa deploy_rsa.pub\n\n# Add changes\ngit add deploy_rsa.enc .travis.yml\n```\n\nThe corresponding lines in `.travis.yml` are added by `travis`, but will have to be moved to the `before_deploy` step in `.travis.yml` including the `ssh-agent` step etc.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjemus42%2Fbookdown-debugging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjemus42%2Fbookdown-debugging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjemus42%2Fbookdown-debugging/lists"}