Skip to contents

do_drat() builds and deploys R packages to a drat repository and adds default steps to the "install", "before_deploy" and "deploy" stages:

  1. step_setup_ssh() in the "before_deploy" to setup the upcoming deployment

  2. step_setup_push_deploy() in the "before_deploy" stage (if deploy is set),

  3. step_add_to_drat() in the "deploy"

  4. step_do_push_deploy() in the "deploy" stage.


  repo_slug = NULL,
  orphan = FALSE,
  checkout = TRUE,
  path = "~/git/drat",
  branch = NULL,
  remote_url = NULL,
  commit_message = NULL,
  commit_paths = ".",
  force = FALSE,
  private_key_name = "TIC_DEPLOY_KEY",
  deploy_dev = FALSE



The name of the drat repository to deploy to in the form :owner/:repo.


Create and force-push an orphan branch consisting of only one commit? This can be useful e.g. for path = "docs", branch = "gh-pages", but cannot be applied for pushing to the current branch.


Check out the current contents of the repository? Defaults to TRUE, set to FALSE if the build process relies on existing contents or if you deploy to a different branch.

path, branch

By default, this macro deploys the default repo branch (usually "master") of the drat repository. An alternative option is "gh-pages".


The URL of the remote Git repository to push to, defaults to the current GitHub repository.


Commit message to use, defaults to a useful message linking to the CI build and avoiding recursive CI runs.


Restrict the set of directories and/or files added to Git before deploying. Default: deploy all files.


Add --force flag to git commands?


Only needed when deploying from builds on GitHub Actions. If you have set a custom name for the private key during creation of the SSH key pair via tic::use_ghactions_deploy()] or use_tic(), pass this name here.


Should development versions of packages also be deployed to the drat repo? By default only "major", "minor" and "patch" releases are build and deployed.


Deployment can only happen to the default repo branch (usually "master") or gh-pages branch because the GitHub Pages functionality from GitHub is used to access the drat repository later on. You need to enable this functionality when creating the drat repository on GitHub via Settings -> GitHub pages and set it to the chosen setting here.

To build and deploy Windows and macOS binaries, builds with deployment permissions need to be triggered. Have a look at for more information and instructions.


if (FALSE) {