Build and deploy individual site components to a remote branchSource:
These are the internal functions which provision and deploy lesson
components to orphan git branches. These are called by
These functions have the side-effect of creating and updating orphan
branches on a remote repository. It is assumed that you have access to your
ci_build_markdown( path = ".", branch = "md-outputs", remote = "origin", reset = FALSE ) ci_build_site( path = ".", branch = "gh-pages", md = "md-outputs", remote = "origin", reset = FALSE )
path to the lesson
the branch name containing the output:
ci_build_markdown(): defaults to
md-output, corresponds to
ci_build_site(): defaults to
gh-pages, corresponds to
the name of the git remote to which you should deploy.
TRUE, the markdown cache is cleared before rebuilding, this defaults to
FALSEmeaning the markdown cache will be provisioned and used.
the branch name that contains the markdown outputs
expression()that is evaluated to tear down the worktree that was created.
ci_build_site(): nothing, it is used for its side-effect.
The only place these two functions are used are within
has the de-facto use-case for these functions, thus, this page has no
examples. Both of these functions do the same general process:
provision a git worktree in the appropriate folder with
build the requisite content in that folder
commit and push the contents to the worktree with
There are caveats for each of the two functions as listed in the sections below.
This will not clean up after itself by default. You must save the output in
an object and run
eval(obj) to run the clean up process. This is in place
ci_build_site() can use the worktree from the markdown outputs in
order to build the site.
In addition to the steps listed above, this function needs to verify that it has the materials necessary to build the HTML site.
It first checks for the presence of
site/built/. This folder can be
ci_build_markdown() or by
build_markdown(). If the folder
does not exist or it is empty, then this function will attempt to fetch the
folder from the branch in
Once everything is built and pushed, this function will additionally destroy the work tree.