Learn R Programming

googleCloudRunner (version 0.2.0)

cr_deploy_pkgdown: Deploy a cloudbuild.yml for a pkgdown website of an R package

Description

This builds a pkgdown website each time the trigger fires and deploys it to git

Usage

cr_deploy_pkgdown(
  steps = NULL,
  secret,
  github_repo = "$_GITHUB_REPO",
  cloudbuild_file = "cloudbuild-pkgdown.yml",
  git_email = "googlecloudrunner@r.com",
  env = NULL,
  build_image = "gcr.io/gcer-public/packagetools:master",
  post_setup = NULL,
  post_clone = NULL
)

Arguments

steps

extra steps to run before the pkgdown website steps run

secret

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

github_repo

The GitHub repo to deploy pkgdown website from and to.

cloudbuild_file

The cloudbuild yaml file to write to

git_email

The email the git commands will be identifying as

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

The trigger repository needs to hold an R package configured to build a pkgdown website.

For GitHub, the repository will also need to be linked to the project you are building within, via https://console.cloud.google.com/cloud-build/triggers/connect

The git ssh keys need to be deployed to Google KMS for the deployment of the website - see cr_buildstep_git - this only needs to be done once per Git account. You then need to commit the encrypted ssh key (by default called id_rsa.enc)

See Also

Create your own custom deployment using cr_buildstep_pkgdown which this function uses with some defaults.

Other Deployment functions: cr_deploy_docker(), cr_deploy_git_html(), cr_deploy_github_docker(), cr_deploy_packagetests(), cr_deploy_run(), cr_deploy_r()

Examples

Run this code
# NOT RUN {
pd <- cr_deploy_pkgdown(secret = "my_git_secret")
pd
file.exists("cloudbuild-pkgdown.yml")
unlink("cloudbuild-pkgdown.yml")

# }

Run the code above in your browser using DataLab