Skip to contents

Adds to known hosts, installs private key, and tests the connection. Chaining step_install_ssh_keys(), step_add_to_known_hosts() and step_test_ssh(). use_tic() encodes a private key as an environment variable for use with this function.

Usage

step_setup_ssh(
  private_key_name = "TIC_DEPLOY_KEY",
  host = "github.com",
  url = paste0("git@", host),
  verbose = ""
)

Arguments

private_key_name

string
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.

host

[string]
The host name to add to the known_hosts file, default: github.com.

url

[string]
URL to establish SSH connection with, by default git@github.com

verbose

[string]
Verbosity, by default "". Use -v or "-vvv" for more verbosity.

Examples

dsl_init()
#>  Creating a clean tic stage configuration
#>  See `?tic::dsl_get` for details

get_stage("script") %>%
  add_step(step_setup_ssh(host = "gitlab.com"))

dsl_get()
#> ── tic configuration summary ───────────────────────────────────────────────────
#> ── Stage: script ───────────────────────────────────────────────────────────────
#>  step_setup_ssh(host="gitlab.com")