Skip to contents

Clones a repo, inits author information, and sets up remotes for a subsequent step_do_push_deploy().

Usage

step_setup_push_deploy(
  path = ".",
  branch = NULL,
  orphan = FALSE,
  remote_url = NULL,
  checkout = TRUE
)

Arguments

path

[string]
Path to the repository, default "." which means setting up the current repository.

branch

[string]
Target branch, default: current branch.

orphan

[flag]
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.

remote_url

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

checkout

[flag]
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.

Examples

if (FALSE) {
dsl_init()

get_stage("deploy") %>%
  add_step(step_setup_push_deploy(path = "docs", branch = "gh-pages")) %>%
  add_step(step_build_pkgdown())

# This example needs a Git repository
if (rlang::is_installed("git2r") && git2r::in_repository()) {
  # Deployment only works if a companion step_do_push_deploy() is added
  get_stage("deploy") %>%
    add_step(step_do_push_deploy(path = "docs"))
}

dsl_get()
}