cr_buildstep_pkgdown {googleCloudRunner}R Documentation

Create buildsteps for deploying an R pkgdown website to GitHub

Description

Create buildsteps for deploying an R pkgdown website to GitHub

Usage

cr_buildstep_pkgdown(
  github_repo,
  git_email,
  secret,
  env = NULL,
  build_image = "gcr.io/gcer-public/packagetools:latest",
  post_setup = NULL,
  post_clone = NULL
)

Arguments

github_repo

The GitHub repo to deploy pkgdown website from and to.

git_email

The email the git commands will be identifying as

secret

The name of the secret on Google Secret Manager for the git ssh private key

env

A character vector of env arguments to set for all steps

build_image

A docker image with pkgdown installed

post_setup

Steps that occur after git setup

post_clone

A cr_buildstep that occurs after the repo is cloned

Details

Its convenient to set some of the above via Build macros, such as github_repo=$_GITHUB_REPO and git_email=$_BUILD_EMAIL in the Build Trigger web UI

To commit the website to git, cr_buildstep_gitsetup is used for which you will need to add your git ssh private key to Google Secret Manager

The R package is installed via install before running build_site

See Also

Other Cloud Buildsteps: cr_buildstep_bash(), cr_buildstep_decrypt(), cr_buildstep_df(), cr_buildstep_docker(), cr_buildstep_edit(), cr_buildstep_extract(), cr_buildstep_gcloud(), cr_buildstep_gitsetup(), cr_buildstep_mailgun(), cr_buildstep_nginx_setup(), cr_buildstep_packagetests(), cr_buildstep_run(), cr_buildstep_r(), cr_buildstep_secret(), cr_buildstep_slack(), cr_buildstep_targets(), cr_buildstep()

Examples

cr_project_set("my-project")
cr_bucket_set("my-bucket")

# set github repo directly to write it out via cr_build_write()
cr_buildstep_pkgdown("MarkEdmondson1234/googleCloudRunner",
  git_email = "cloudbuild@google.com",
  secret = "github-ssh"
)

# github repo set via build trigger macro _GITHUB_REPO
cr_buildstep_pkgdown("$_GITHUB_REPO",
  git_email = "cloudbuild@google.com",
  secret = "github-ssh"
)

# example including environment arguments for pkgdown build step
cr_buildstep_pkgdown("$_GITHUB_REPO",
  git_email = "cloudbuild@google.com",
  secret = "github-ssh",
  env = c("MYVAR=$_MY_VAR", "PROJECT=$PROJECT_ID")
)

[Package googleCloudRunner version 0.5.0 Index]