View source: R/buildsteps_templates.R
cr_buildstep_pkgdown | R Documentation |
Create buildsteps for deploying an R pkgdown website to GitHub
cr_buildstep_pkgdown( github_repo, git_email, secret, env = NULL, build_image = "gcr.io/gcer-public/packagetools:latest", post_setup = NULL, post_clone = NULL )
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 |
post_setup |
Steps that occur after git setup |
post_clone |
A cr_buildstep that occurs after the repo is cloned |
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
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()
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") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.