Skip to contents

A platform-agnostic method of deploying a lesson website and cached content. This function takes advantage of git worktrees to render and push content to orphan branches, which can be used to host the lesson website. This function assumes that you are in a git clone from a remote and have write access to that remote.

Usage

ci_deploy(
  path = ".",
  md_branch = "md-outputs",
  site_branch = "gh-pages",
  remote = "origin",
  reset = FALSE
)

Arguments

path

path to the lesson

md_branch

the branch name that contains the markdown outputs

site_branch

the branch name that contains the full HTML site

remote

the name of the git remote to which you should deploy.

reset

if TRUE, the markdown cache is cleared before rebuilding, this defaults to FALSE meaning the markdown cache will be provisioned and used.

Value

Nothing, invisibly. This is used for it's side-effect

Details

ci_deploy() does the same thing as build_lesson(), except instead of storing the outputs under the site/ folder, it pushes the outputs to remote orphan branches (determined by the md_branch and site_branch arguments). These branches are used as the cache and the website, respectively. If these branches do not exist, they will be created.

Requirements

This function can only run in a non-interactive fashion. If you try to run it interactively, you will get an error message. It assumes that the following are true:

  • it is running in a script or automated workflow

  • it is running in a clone of a git repository

  • the remote exists and is writable

Unexpected consequences can arise from violating these assumptions.

Workflow

This function has a similar two-step workflow as build_lesson(), with a few extra steps to ensure that the git branches are set up correctly. Below are the steps with elements common to build_lesson() annotated with *

  1. check that a git user and email is registered

  2. * Validate the lesson and generate global variables with validate_lesson()

  3. provision, build, and deploy markdown branch with ci_build_markdown() i. provision markdown branch with git_worktree_setup() ii. * build the markdown source documents with build_markdown() iii. commit and push the git worktree to the remote branch with github_worktree_commit()

  4. provision, build, and deploy site branch with ci_build_site() i. provision site branch with git_worktree_setup() ii. * build the site HTML documents with build_site() iii. commit and push the git worktree to the remote branch with github_worktree_commit() iv. remove the git worktree with github_worktree_remove()

  5. remove markdown git worktree with github_worktree_remove()

Note

this function is not for interactive use. It requires git to be installed on your machine and will destroy anything you have in the site/ folder. For R-based lessons it will rebuild all components if the lockfile has changed.

Examples

# For this example, we are setting up a temporary repository with a local
# remote called `sandpaper-local`. This demonstrates how `ci_deploy()`
# modifies the remote, but there are setup and teardown steps to run.
# The actual example is highlighted below under the DEPLOY comment.

# SETUP -------------------------------------------------------------------
snd <- asNamespace("sandpaper")
tik <- Sys.time()
cli::cli_h1("Set up")
#> 
#> ── Set up ──────────────────────────────────────────────────────────────
cli::cli_h2("Create Lesson")
#> 
#> ── Create Lesson ──
#> 
restore_fixture <- snd$create_test_lesson()
#> → Bootstrapping example lesson
#> - The project is out-of-sync -- use `renv::status()` for details.
#> → Searching for and installing available dependencies
#> The following packages were discovered:
#> 
#> # ~/work/_temp/Library -------------------------------------------------------
#> - R6            2.5.1
#> - base64enc     0.1-3
#> - bslib         0.7.0
#> - cachem        1.1.0
#> - cli           3.6.3
#> - digest        0.6.36
#> - evaluate      0.24.0
#> - fastmap       1.2.0
#> - fontawesome   0.5.2
#> - fs            1.6.4
#> - glue          1.7.0
#> - highr         0.11
#> - htmltools     0.5.8.1
#> - jquerylib     0.1.4
#> - jsonlite      1.8.8
#> - knitr         1.48
#> - lifecycle     1.0.4
#> - memoise       2.0.1
#> - mime          0.12
#> - rappdirs      0.3.3
#> - rlang         1.1.4
#> - rmarkdown     2.27
#> - sass          0.4.9
#> - tinytex       0.52
#> - xfun          0.46
#> - yaml          2.3.10
#> 
#> They will be copied into the project library.
#> 
#> - Copying packages into the project library ... Done!
#> - Hydrated 26 packages in 0.24 seconds.
#> - Resolving missing dependencies ... 
#> # Installing packages --------------------------------------------------------
#> - The project is out-of-sync -- use `renv::status()` for details.
#> → Recording changes in lockfile
#> The following package(s) will be updated in the lockfile:
#> 
#> # GitHub ---------------------------------------------------------------------
#> - renv          [* -> rstudio/renv]
#> 
#> # https://packagemanager.posit.co/cran/__linux__/jammy/latest ----------------
#> - R6            [* -> 2.5.1]
#> - base64enc     [* -> 0.1-3]
#> - bslib         [* -> 0.7.0]
#> - cachem        [* -> 1.1.0]
#> - cli           [* -> 3.6.3]
#> - digest        [* -> 0.6.36]
#> - evaluate      [* -> 0.24.0]
#> - fastmap       [* -> 1.2.0]
#> - fontawesome   [* -> 0.5.2]
#> - fs            [* -> 1.6.4]
#> - glue          [* -> 1.7.0]
#> - highr         [* -> 0.11]
#> - htmltools     [* -> 0.5.8.1]
#> - jquerylib     [* -> 0.1.4]
#> - jsonlite      [* -> 1.8.8]
#> - knitr         [* -> 1.48]
#> - lifecycle     [* -> 1.0.4]
#> - memoise       [* -> 2.0.1]
#> - mime          [* -> 0.12]
#> - rappdirs      [* -> 0.3.3]
#> - rlang         [* -> 1.1.4]
#> - rmarkdown     [* -> 2.27]
#> - sass          [* -> 0.4.9]
#> - tinytex       [* -> 0.52]
#> - xfun          [* -> 0.46]
#> - yaml          [* -> 2.3.10]
#> 
#> The version of R recorded in the lockfile will be updated:
#> - R             [* -> 4.4.1]
#> 
#> - Lockfile written to "/tmp/RtmpP9eYUD/file1932450c768a/lesson-example/renv/profiles/lesson-requirements/renv.lock".
res <- getOption("sandpaper.test_fixture")
cli::cli_h2("Create Remote")
#> 
#> ── Create Remote ──
#> 
rmt <- fs::file_temp(pattern = "REMOTE-")
snd$setup_local_remote(repo = res, remote = rmt, verbose = FALSE)
tok <- Sys.time()
cli::cli_alert_info("Elapsed time: {round(tok - tik, 2)} seconds")
#>  Elapsed time: 3.08 seconds

# reporting -----
# The repository should only have one branch and the remote should be in
# sync with the local.
cli::cli_h2("Local status")
#> 
#> ── Local status ──
#> 
gert::git_branch_list(repo = res)[c('name', 'commit', 'updated')]
#> # A tibble: 2 × 3
#>   name                 commit                        updated            
#>   <chr>                <chr>                         <dttm>             
#> 1 main                 b43b0e390e98c3f9578799f09b7f… 2024-07-29 13:14:32
#> 2 sandpaper-local/main b43b0e390e98c3f9578799f09b7f… 2024-07-29 13:14:32
cli::cli_h2("First episode status")
#> ── First episode status ──
#> 
gert::git_stat_files("episodes/introduction.Rmd", repo = res)
#> # A tibble: 1 × 5
#>   file             created             modified            commits head 
#> * <chr>            <dttm>              <dttm>                <int> <chr>
#> 1 episodes/introd… 2024-07-29 13:14:32 2024-07-29 13:14:32       1 b43b…
gert::git_stat_files("episodes/introduction.Rmd", repo = rmt)
#> # A tibble: 1 × 5
#>   file             created             modified            commits head 
#> * <chr>            <dttm>              <dttm>                <int> <chr>
#> 1 episodes/introd… 2024-07-29 13:14:32 2024-07-29 13:14:32       1 b43b…

# DEPLOY ------------------------------------------------------------------
tik <- Sys.time()
cli::cli_h1("deploy to remote")
#> ── deploy to remote ────────────────────────────────────────────────────
sandpaper:::ci_deploy(path = res, remote = "sandpaper-local")
#> ── Validating Fenced Divs ──────────────────────────────────────────────
#> ── Validating Internal Links and Images ────────────────────────────────
#> ! There were errors in 13/37 links
#> ◌ Links must use HTTPS <https://https.cio.gov/everything/>
#> ◌ Some linked internal files do not exist <https://carpentries.github.io/sandpaper/articles/include-child-documents.html#workspace-consideration>
#> 
#> ::warning file=CONTRIBUTING.md,line=3:: [needs HTTPS]: [Software Carpentry](http://software-carpentry.org/)
#> ::warning file=CONTRIBUTING.md,line=3:: [needs HTTPS]: [Data Carpentry](http://datacarpentry.org/)
#> ::warning file=CONTRIBUTING.md,line=17:: [needs HTTPS]: [Software Carpentry](http://software-carpentry.org/)
#> ::warning file=CONTRIBUTING.md,line=17:: [needs HTTPS]: [Data Carpentry](http://datacarpentry.org/)
#> ::warning file=CONTRIBUTING.md,line=18:: [missing file]: [code of conduct](CONDUCT.md)
#> ::warning file=CONTRIBUTING.md,line=29:: [needs HTTPS]: [GitHub](http://github.com)
#> ::warning file=CONTRIBUTING.md,line=34:: [needs HTTPS]: [GitHub](http://github.com)
#> ::warning file=CONTRIBUTING.md,line=114:: [needs HTTPS]: [Software Carpentry](http://software-carpentry.org/)
#> ::warning file=CONTRIBUTING.md,line=114:: [needs HTTPS]: [Data Carpentry](http://datacarpentry.org/)
#> ::warning file=CONTRIBUTING.md,line=115:: [needs HTTPS]: [discussion mailing list](http://lists.software-carpentry.org/listinfo/discuss)
#> ::warning file=LICENSE.md,line=28:: [needs HTTPS]: [http://software-carpentry.org/](http://software-carpentry.org/)
#> ::warning file=LICENSE.md,line=76:: [needs HTTPS]: [Community Initiatives](http://communityin.org/)
#> ::warning file=learners/setup.md,line=10:: [missing file]: [data zip file](data/data.zip)
#> ::group::Create New Branch
#> Running git checkout --orphan md-outputs
#> Switched to a new branch 'md-outputs'
#> Running git rm -rf --quiet .
#> Running git commit --allow-empty -m 'Initializing md-outputs branch'
#> [md-outputs (root-commit) 55fe529] Initializing md-outputs branch
#> Running git push sandpaper-local 'HEAD:md-outputs'
#> To /tmp/RtmpP9eYUD/REMOTE-19323127c1ae
#>  * [new branch]      HEAD -> md-outputs
#> Running git checkout main
#> Switched to branch 'main'
#> Your branch is up to date with 'sandpaper-local/main'.
#> ::endgroup::
#> ::group::Fetch sandpaper-local/md-outputs
#> Running git remote set-branches sandpaper-local md-outputs
#> Running git fetch sandpaper-local md-outputs
#> From /tmp/RtmpP9eYUD/REMOTE-19323127c1ae
#>  * branch            md-outputs -> FETCH_HEAD
#> Running git remote set-branches sandpaper-local '*'
#> ::endgroup::
#> ::group::Add worktree for sandpaper-local/md-outputs in site/built
#> Running git worktree add --track -B md-outputs \
#>   /tmp/RtmpP9eYUD/file1932450c768a/lesson-example/site/built \
#>   sandpaper-local/md-outputs
#> Preparing worktree (resetting branch 'md-outputs'; was at 55fe529)
#> branch 'md-outputs' set up to track 'sandpaper-local/md-outputs'.
#> HEAD is now at 55fe529 Initializing md-outputs branch
#> ::endgroup::
#> ::group::Build Markdown Sources
#>  Consent to use package cache provided
#> → Searching for and installing available dependencies
#> Finding R package dependencies ... Done!
#> → Restoring any dependency versions
#> - The library is already synchronized with the lockfile.
#> → Recording changes in lockfile
#> - The lockfile is already up to date.
#>  Using package cache in /home/runner/.cache/R/renv
#> 
#> 
#> processing file: /tmp/RtmpP9eYUD/file1932450c768a/lesson-example/episodes/introduction.Rmd
#> 1/3          
#> 2/3 [pyramid]
#> 3/3          
#> output file: /tmp/RtmpP9eYUD/file1932450c768a/lesson-example/site/built/introduction.md
#> 
#> ::endgroup::
#> ::group::Commit Markdown Sources
#> Running git commit --allow-empty -m \
#>   'markdown source builds
#> 
#> Auto-generated via {sandpaper}
#> Source  : b43b0e390e98c3f9578799f09b7f0f05230a7535
#> Branch  : main
#> Author  : carpenter <team@carpentries.org>
#> Time    : 2024-07-29 13:14:32 +0000
#> Message : Initial commit [via {sandpaper}]
#> '
#> [md-outputs 04d3154] markdown source builds
#>  12 files changed, 727 insertions(+)
#>  create mode 100644 CODE_OF_CONDUCT.md
#>  create mode 100644 LICENSE.md
#>  create mode 100644 config.yaml
#>  create mode 100644 fig/introduction-rendered-pyramid-1.png
#>  create mode 100644 index.md
#>  create mode 100644 instructor-notes.md
#>  create mode 100644 introduction.md
#>  create mode 100644 learner-profiles.md
#>  create mode 100644 links.md
#>  create mode 100644 md5sum.txt
#>  create mode 100644 renv.lock
#>  create mode 100644 setup.md
#> Running git remote -v
#> sandpaper-local	/tmp/RtmpP9eYUD/REMOTE-19323127c1ae (fetch)
#> sandpaper-local	/tmp/RtmpP9eYUD/REMOTE-19323127c1ae (push)
#> Running git push --force sandpaper-local 'HEAD:md-outputs'
#> To /tmp/RtmpP9eYUD/REMOTE-19323127c1ae
#>    55fe529..04d3154  HEAD -> md-outputs
#> ::endgroup::
#> ::group::Create New Branch
#> Running git checkout --orphan gh-pages
#> Switched to a new branch 'gh-pages'
#> Running git rm -rf --quiet .
#> Running git commit --allow-empty -m 'Initializing gh-pages branch'
#> [gh-pages (root-commit) 3b00149] Initializing gh-pages branch
#> Running git push sandpaper-local 'HEAD:gh-pages'
#> To /tmp/RtmpP9eYUD/REMOTE-19323127c1ae
#>  * [new branch]      HEAD -> gh-pages
#> Running git checkout main
#> Switched to branch 'main'
#> Your branch is up to date with 'sandpaper-local/main'.
#> ::endgroup::
#> ::group::Fetch sandpaper-local/gh-pages
#> Running git remote set-branches sandpaper-local gh-pages
#> Running git fetch sandpaper-local gh-pages
#> From /tmp/RtmpP9eYUD/REMOTE-19323127c1ae
#>  * branch            gh-pages   -> FETCH_HEAD
#> Running git remote set-branches sandpaper-local '*'
#> ::endgroup::
#> ::group::Add worktree for sandpaper-local/gh-pages in site/docs
#> Running git worktree add --track -B gh-pages \
#>   /tmp/RtmpP9eYUD/file1932450c768a/lesson-example/site/docs \
#>   sandpaper-local/gh-pages
#> Preparing worktree (resetting branch 'gh-pages'; was at 3b00149)
#> branch 'gh-pages' set up to track 'sandpaper-local/gh-pages'.
#> HEAD is now at 3b00149 Initializing gh-pages branch
#> ::endgroup::
#> ::group::Build Lesson Website
#>  pandoc found
#>   version : 3.1.11
#>   path    : /opt/hostedtoolcache/pandoc/3.1.11/x64
#> ── Initialising site ───────────────────────────────────────────────────
#> Copying <pkgdown>/BS3/assets/bootstrap-toc.css to bootstrap-toc.css
#> Copying <pkgdown>/BS3/assets/bootstrap-toc.js to bootstrap-toc.js
#> Copying <pkgdown>/BS3/assets/docsearch.css to docsearch.css
#> Copying <pkgdown>/BS3/assets/docsearch.js to docsearch.js
#> Copying <pkgdown>/BS3/assets/link.svg to link.svg
#> Copying <pkgdown>/BS3/assets/pkgdown.css to pkgdown.css
#> Copying <pkgdown>/BS3/assets/pkgdown.js to pkgdown.js
#> Copying <varnish>/pkgdown/assets/android-chrome-192x192.png to
#> android-chrome-192x192.png
#> Copying <varnish>/pkgdown/assets/android-chrome-512x512.png to
#> android-chrome-512x512.png
#> Copying <varnish>/pkgdown/assets/apple-touch-icon.png to
#> apple-touch-icon.png
#> Copying <varnish>/pkgdown/assets/assets/fonts/Mulish-Bold.ttf to
#> assets/fonts/Mulish-Bold.ttf
#> Copying <varnish>/pkgdown/assets/assets/fonts/Mulish-Bold.woff to
#> assets/fonts/Mulish-Bold.woff
#> Copying <varnish>/pkgdown/assets/assets/fonts/Mulish-ExtraBold.ttf to
#> assets/fonts/Mulish-ExtraBold.ttf
#> Copying
#> <varnish>/pkgdown/assets/assets/fonts/mulish-v5-latin-regular.eot to
#> assets/fonts/mulish-v5-latin-regular.eot
#> Copying
#> <varnish>/pkgdown/assets/assets/fonts/mulish-v5-latin-regular.svg to
#> assets/fonts/mulish-v5-latin-regular.svg
#> Copying
#> <varnish>/pkgdown/assets/assets/fonts/mulish-v5-latin-regular.ttf to
#> assets/fonts/mulish-v5-latin-regular.ttf
#> Copying
#> <varnish>/pkgdown/assets/assets/fonts/mulish-v5-latin-regular.woff to
#> assets/fonts/mulish-v5-latin-regular.woff
#> Copying
#> <varnish>/pkgdown/assets/assets/fonts/mulish-v5-latin-regular.woff2 to
#> assets/fonts/mulish-v5-latin-regular.woff2
#> Copying
#> <varnish>/pkgdown/assets/assets/fonts/mulish-variablefont_wght.woff to
#> assets/fonts/mulish-variablefont_wght.woff
#> Copying
#> <varnish>/pkgdown/assets/assets/fonts/mulish-variablefont_wght.woff2 to
#> assets/fonts/mulish-variablefont_wght.woff2
#> Copying <varnish>/pkgdown/assets/assets/images/carpentries-logo-sm.svg
#> to assets/images/carpentries-logo-sm.svg
#> Copying <varnish>/pkgdown/assets/assets/images/carpentries-logo.svg to
#> assets/images/carpentries-logo.svg
#> Copying <varnish>/pkgdown/assets/assets/images/data-logo-sm.svg to
#> assets/images/data-logo-sm.svg
#> Copying <varnish>/pkgdown/assets/assets/images/data-logo.svg to
#> assets/images/data-logo.svg
#> Copying <varnish>/pkgdown/assets/assets/images/dropdown-arrow.svg to
#> assets/images/dropdown-arrow.svg
#> Copying <varnish>/pkgdown/assets/assets/images/incubator-logo-sm.svg to
#> assets/images/incubator-logo-sm.svg
#> Copying <varnish>/pkgdown/assets/assets/images/incubator-logo.svg to
#> assets/images/incubator-logo.svg
#> Copying <varnish>/pkgdown/assets/assets/images/lab-logo-sm.svg to
#> assets/images/lab-logo-sm.svg
#> Copying <varnish>/pkgdown/assets/assets/images/lab-logo.svg to
#> assets/images/lab-logo.svg
#> Copying <varnish>/pkgdown/assets/assets/images/library-logo-sm.svg to
#> assets/images/library-logo-sm.svg
#> Copying <varnish>/pkgdown/assets/assets/images/library-logo.svg to
#> assets/images/library-logo.svg
#> Copying <varnish>/pkgdown/assets/assets/images/minus.svg to
#> assets/images/minus.svg
#> Copying <varnish>/pkgdown/assets/assets/images/plus.svg to
#> assets/images/plus.svg
#> Copying <varnish>/pkgdown/assets/assets/images/software-logo-sm.svg to
#> assets/images/software-logo-sm.svg
#> Copying <varnish>/pkgdown/assets/assets/images/software-logo.svg to
#> assets/images/software-logo.svg
#> Copying <varnish>/pkgdown/assets/assets/scripts.js to assets/scripts.js
#> Copying <varnish>/pkgdown/assets/assets/styles.css to assets/styles.css
#> Copying <varnish>/pkgdown/assets/assets/styles.css.map to
#> assets/styles.css.map
#> Copying <varnish>/pkgdown/assets/assets/themetoggle.js to
#> assets/themetoggle.js
#> Copying <varnish>/pkgdown/assets/favicon-16x16.png to favicon-16x16.png
#> Copying <varnish>/pkgdown/assets/favicon-32x32.png to favicon-32x32.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/cp/apple-touch-icon-114x114.png to
#> favicons/cp/apple-touch-icon-114x114.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/cp/apple-touch-icon-120x120.png to
#> favicons/cp/apple-touch-icon-120x120.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/cp/apple-touch-icon-144x144.png to
#> favicons/cp/apple-touch-icon-144x144.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/cp/apple-touch-icon-152x152.png to
#> favicons/cp/apple-touch-icon-152x152.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/apple-touch-icon-57x57.png
#> to favicons/cp/apple-touch-icon-57x57.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/apple-touch-icon-60x60.png
#> to favicons/cp/apple-touch-icon-60x60.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/apple-touch-icon-72x72.png
#> to favicons/cp/apple-touch-icon-72x72.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/apple-touch-icon-76x76.png
#> to favicons/cp/apple-touch-icon-76x76.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/favicon-128.png to
#> favicons/cp/favicon-128.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/favicon-16x16.png to
#> favicons/cp/favicon-16x16.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/favicon-196x196.png to
#> favicons/cp/favicon-196x196.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/favicon-32x32.png to
#> favicons/cp/favicon-32x32.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/favicon-96x96.png to
#> favicons/cp/favicon-96x96.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/favicon.ico to
#> favicons/cp/favicon.ico
#> Copying <varnish>/pkgdown/assets/favicons/cp/mstile-144x144.png to
#> favicons/cp/mstile-144x144.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/mstile-150x150.png to
#> favicons/cp/mstile-150x150.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/mstile-310x150.png to
#> favicons/cp/mstile-310x150.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/mstile-310x310.png to
#> favicons/cp/mstile-310x310.png
#> Copying <varnish>/pkgdown/assets/favicons/cp/mstile-70x70.png to
#> favicons/cp/mstile-70x70.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/dc/apple-touch-icon-114x114.png to
#> favicons/dc/apple-touch-icon-114x114.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/dc/apple-touch-icon-120x120.png to
#> favicons/dc/apple-touch-icon-120x120.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/dc/apple-touch-icon-144x144.png to
#> favicons/dc/apple-touch-icon-144x144.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/dc/apple-touch-icon-152x152.png to
#> favicons/dc/apple-touch-icon-152x152.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/apple-touch-icon-57x57.png
#> to favicons/dc/apple-touch-icon-57x57.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/apple-touch-icon-60x60.png
#> to favicons/dc/apple-touch-icon-60x60.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/apple-touch-icon-72x72.png
#> to favicons/dc/apple-touch-icon-72x72.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/apple-touch-icon-76x76.png
#> to favicons/dc/apple-touch-icon-76x76.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/favicon-128.png to
#> favicons/dc/favicon-128.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/favicon-16x16.png to
#> favicons/dc/favicon-16x16.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/favicon-196x196.png to
#> favicons/dc/favicon-196x196.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/favicon-32x32.png to
#> favicons/dc/favicon-32x32.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/favicon-96x96.png to
#> favicons/dc/favicon-96x96.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/favicon.ico to
#> favicons/dc/favicon.ico
#> Copying <varnish>/pkgdown/assets/favicons/dc/mstile-144x144.png to
#> favicons/dc/mstile-144x144.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/mstile-150x150.png to
#> favicons/dc/mstile-150x150.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/mstile-310x150.png to
#> favicons/dc/mstile-310x150.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/mstile-310x310.png to
#> favicons/dc/mstile-310x310.png
#> Copying <varnish>/pkgdown/assets/favicons/dc/mstile-70x70.png to
#> favicons/dc/mstile-70x70.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/lc/apple-touch-icon-114x114.png to
#> favicons/lc/apple-touch-icon-114x114.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/lc/apple-touch-icon-120x120.png to
#> favicons/lc/apple-touch-icon-120x120.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/lc/apple-touch-icon-144x144.png to
#> favicons/lc/apple-touch-icon-144x144.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/lc/apple-touch-icon-152x152.png to
#> favicons/lc/apple-touch-icon-152x152.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/apple-touch-icon-57x57.png
#> to favicons/lc/apple-touch-icon-57x57.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/apple-touch-icon-60x60.png
#> to favicons/lc/apple-touch-icon-60x60.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/apple-touch-icon-72x72.png
#> to favicons/lc/apple-touch-icon-72x72.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/apple-touch-icon-76x76.png
#> to favicons/lc/apple-touch-icon-76x76.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/favicon-128.png to
#> favicons/lc/favicon-128.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/favicon-16x16.png to
#> favicons/lc/favicon-16x16.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/favicon-196x196.png to
#> favicons/lc/favicon-196x196.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/favicon-32x32.png to
#> favicons/lc/favicon-32x32.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/favicon-96x96.png to
#> favicons/lc/favicon-96x96.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/favicon.ico to
#> favicons/lc/favicon.ico
#> Copying <varnish>/pkgdown/assets/favicons/lc/mstile-144x144.png to
#> favicons/lc/mstile-144x144.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/mstile-150x150.png to
#> favicons/lc/mstile-150x150.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/mstile-310x150.png to
#> favicons/lc/mstile-310x150.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/mstile-310x310.png to
#> favicons/lc/mstile-310x310.png
#> Copying <varnish>/pkgdown/assets/favicons/lc/mstile-70x70.png to
#> favicons/lc/mstile-70x70.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/swc/apple-touch-icon-114x114.png to
#> favicons/swc/apple-touch-icon-114x114.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/swc/apple-touch-icon-120x120.png to
#> favicons/swc/apple-touch-icon-120x120.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/swc/apple-touch-icon-144x144.png to
#> favicons/swc/apple-touch-icon-144x144.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/swc/apple-touch-icon-152x152.png to
#> favicons/swc/apple-touch-icon-152x152.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/swc/apple-touch-icon-57x57.png to
#> favicons/swc/apple-touch-icon-57x57.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/swc/apple-touch-icon-60x60.png to
#> favicons/swc/apple-touch-icon-60x60.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/swc/apple-touch-icon-72x72.png to
#> favicons/swc/apple-touch-icon-72x72.png
#> Copying
#> <varnish>/pkgdown/assets/favicons/swc/apple-touch-icon-76x76.png to
#> favicons/swc/apple-touch-icon-76x76.png
#> Copying <varnish>/pkgdown/assets/favicons/swc/favicon-128.png to
#> favicons/swc/favicon-128.png
#> Copying <varnish>/pkgdown/assets/favicons/swc/favicon-16x16.png to
#> favicons/swc/favicon-16x16.png
#> Copying <varnish>/pkgdown/assets/favicons/swc/favicon-196x196.png to
#> favicons/swc/favicon-196x196.png
#> Copying <varnish>/pkgdown/assets/favicons/swc/favicon-32x32.png to
#> favicons/swc/favicon-32x32.png
#> Copying <varnish>/pkgdown/assets/favicons/swc/favicon-96x96.png to
#> favicons/swc/favicon-96x96.png
#> Copying <varnish>/pkgdown/assets/favicons/swc/favicon.ico to
#> favicons/swc/favicon.ico
#> Copying <varnish>/pkgdown/assets/favicons/swc/mstile-144x144.png to
#> favicons/swc/mstile-144x144.png
#> Copying <varnish>/pkgdown/assets/favicons/swc/mstile-150x150.png to
#> favicons/swc/mstile-150x150.png
#> Copying <varnish>/pkgdown/assets/favicons/swc/mstile-310x150.png to
#> favicons/swc/mstile-310x150.png
#> Copying <varnish>/pkgdown/assets/favicons/swc/mstile-310x310.png to
#> favicons/swc/mstile-310x310.png
#> Copying <varnish>/pkgdown/assets/favicons/swc/mstile-70x70.png to
#> favicons/swc/mstile-70x70.png
#> Copying <varnish>/pkgdown/assets/mstile-150x150.png to
#> mstile-150x150.png
#> Copying <varnish>/pkgdown/assets/safari-pinned-tab.svg to
#> safari-pinned-tab.svg
#> Copying <varnish>/pkgdown/assets/site.webmanifest to site.webmanifest
#> ── Scanning episodes to rebuild ────────────────────────────────────────
#> Writing `instructor/CODE_OF_CONDUCT.html`
#> Writing `CODE_OF_CONDUCT.html`
#> Writing `instructor/LICENSE.html`
#> Writing `LICENSE.html`
#> Writing `instructor/introduction.html`
#> Writing `introduction.html`
#> ── Creating learner profiles ───────────────────────────────────────────
#> Writing `instructor/profiles.html`
#> Writing `profiles.html`
#> ── Creating homepage ───────────────────────────────────────────────────
#> Writing `instructor/index.html`
#> Writing `index.html`
#> ── Creating keypoints summary ──────────────────────────────────────────
#> Writing 'instructor/key-points.html'
#> Writing 'key-points.html'
#> ── Creating All-in-one page ────────────────────────────────────────────
#> Writing 'instructor/aio.html'
#> Writing 'aio.html'
#> ── Creating Images page ────────────────────────────────────────────────
#> Writing 'instructor/images.html'
#> Writing 'images.html'
#> ── Creating Instructor Notes ───────────────────────────────────────────
#> Writing 'instructor/instructor-notes.html'
#> Writing 'instructor-notes.html'
#> ── Creating sitemap.xml ────────────────────────────────────────────────
#> 
#> Output created: /tmp/RtmpP9eYUD/file1932450c768a/lesson-example/site/docs/index.html
#> ::endgroup::
#> ::group::Commit Lesson Website
#> Running git commit --allow-empty -m \
#>   'site deploy
#> 
#> Auto-generated via {sandpaper}
#> Source  : 04d3154447f73f4d22ac653ef883747af038954d
#> Branch  : md-outputs
#> Author  : GitHub Actions <actions@github.com>
#> Time    : 2024-07-29 13:14:36 +0000
#> Message : markdown source builds
#> 
#> Auto-generated via {sandpaper}
#> Source  : b43b0e390e98c3f9578799f09b7f0f05230a7535
#> Branch  : main
#> Author  : carpenter <team@carpentries.org>
#> Time    : 2024-07-29 13:14:32 +0000
#> Message : Initial commit [via {sandpaper}]
#> '
#> [gh-pages 7057c74] site deploy
#>  145 files changed, 9928 insertions(+)
#>  create mode 100644 .nojekyll
#>  create mode 100644 CODE_OF_CONDUCT.html
#>  create mode 100644 LICENSE.html
#>  create mode 100644 aio.html
#>  create mode 100644 android-chrome-192x192.png
#>  create mode 100644 android-chrome-512x512.png
#>  create mode 100644 apple-touch-icon.png
#>  create mode 100644 assets/fonts/Mulish-Bold.ttf
#>  create mode 100644 assets/fonts/Mulish-Bold.woff
#>  create mode 100644 assets/fonts/Mulish-ExtraBold.ttf
#>  create mode 100644 assets/fonts/mulish-v5-latin-regular.eot
#>  create mode 100644 assets/fonts/mulish-v5-latin-regular.svg
#>  create mode 100644 assets/fonts/mulish-v5-latin-regular.ttf
#>  create mode 100644 assets/fonts/mulish-v5-latin-regular.woff
#>  create mode 100644 assets/fonts/mulish-v5-latin-regular.woff2
#>  create mode 100644 assets/fonts/mulish-variablefont_wght.woff
#>  create mode 100644 assets/fonts/mulish-variablefont_wght.woff2
#>  create mode 100644 assets/images/carpentries-logo-sm.svg
#>  create mode 100644 assets/images/carpentries-logo.svg
#>  create mode 100644 assets/images/data-logo-sm.svg
#>  create mode 100644 assets/images/data-logo.svg
#>  create mode 100644 assets/images/dropdown-arrow.svg
#>  create mode 100644 assets/images/incubator-logo-sm.svg
#>  create mode 100644 assets/images/incubator-logo.svg
#>  create mode 100644 assets/images/lab-logo-sm.svg
#>  create mode 100644 assets/images/lab-logo.svg
#>  create mode 100644 assets/images/library-logo-sm.svg
#>  create mode 100644 assets/images/library-logo.svg
#>  create mode 100644 assets/images/minus.svg
#>  create mode 100644 assets/images/plus.svg
#>  create mode 100644 assets/images/software-logo-sm.svg
#>  create mode 100644 assets/images/software-logo.svg
#>  create mode 100644 assets/scripts.js
#>  create mode 100644 assets/styles.css
#>  create mode 100644 assets/styles.css.map
#>  create mode 100644 assets/themetoggle.js
#>  create mode 100644 bootstrap-toc.css
#>  create mode 100644 bootstrap-toc.js
#>  create mode 100644 config.yaml
#>  create mode 100644 docsearch.css
#>  create mode 100644 docsearch.js
#>  create mode 100644 favicon-16x16.png
#>  create mode 100644 favicon-32x32.png
#>  create mode 100644 favicons/cp/apple-touch-icon-114x114.png
#>  create mode 100644 favicons/cp/apple-touch-icon-120x120.png
#>  create mode 100644 favicons/cp/apple-touch-icon-144x144.png
#>  create mode 100644 favicons/cp/apple-touch-icon-152x152.png
#>  create mode 100644 favicons/cp/apple-touch-icon-57x57.png
#>  create mode 100644 favicons/cp/apple-touch-icon-60x60.png
#>  create mode 100644 favicons/cp/apple-touch-icon-72x72.png
#>  create mode 100644 favicons/cp/apple-touch-icon-76x76.png
#>  create mode 100644 favicons/cp/favicon-128.png
#>  create mode 100644 favicons/cp/favicon-16x16.png
#>  create mode 100644 favicons/cp/favicon-196x196.png
#>  create mode 100644 favicons/cp/favicon-32x32.png
#>  create mode 100644 favicons/cp/favicon-96x96.png
#>  create mode 100644 favicons/cp/favicon.ico
#>  create mode 100644 favicons/cp/mstile-144x144.png
#>  create mode 100644 favicons/cp/mstile-150x150.png
#>  create mode 100644 favicons/cp/mstile-310x150.png
#>  create mode 100644 favicons/cp/mstile-310x310.png
#>  create mode 100644 favicons/cp/mstile-70x70.png
#>  create mode 100644 favicons/dc/apple-touch-icon-114x114.png
#>  create mode 100644 favicons/dc/apple-touch-icon-120x120.png
#>  create mode 100644 favicons/dc/apple-touch-icon-144x144.png
#>  create mode 100644 favicons/dc/apple-touch-icon-152x152.png
#>  create mode 100644 favicons/dc/apple-touch-icon-57x57.png
#>  create mode 100644 favicons/dc/apple-touch-icon-60x60.png
#>  create mode 100644 favicons/dc/apple-touch-icon-72x72.png
#>  create mode 100644 favicons/dc/apple-touch-icon-76x76.png
#>  create mode 100644 favicons/dc/favicon-128.png
#>  create mode 100644 favicons/dc/favicon-16x16.png
#>  create mode 100644 favicons/dc/favicon-196x196.png
#>  create mode 100644 favicons/dc/favicon-32x32.png
#>  create mode 100644 favicons/dc/favicon-96x96.png
#>  create mode 100644 favicons/dc/favicon.ico
#>  create mode 100644 favicons/dc/mstile-144x144.png
#>  create mode 100644 favicons/dc/mstile-150x150.png
#>  create mode 100644 favicons/dc/mstile-310x150.png
#>  create mode 100644 favicons/dc/mstile-310x310.png
#>  create mode 100644 favicons/dc/mstile-70x70.png
#>  create mode 100644 favicons/lc/apple-touch-icon-114x114.png
#>  create mode 100644 favicons/lc/apple-touch-icon-120x120.png
#>  create mode 100644 favicons/lc/apple-touch-icon-144x144.png
#>  create mode 100644 favicons/lc/apple-touch-icon-152x152.png
#>  create mode 100644 favicons/lc/apple-touch-icon-57x57.png
#>  create mode 100644 favicons/lc/apple-touch-icon-60x60.png
#>  create mode 100644 favicons/lc/apple-touch-icon-72x72.png
#>  create mode 100644 favicons/lc/apple-touch-icon-76x76.png
#>  create mode 100644 favicons/lc/favicon-128.png
#>  create mode 100644 favicons/lc/favicon-16x16.png
#>  create mode 100644 favicons/lc/favicon-196x196.png
#>  create mode 100644 favicons/lc/favicon-32x32.png
#>  create mode 100644 favicons/lc/favicon-96x96.png
#>  create mode 100644 favicons/lc/favicon.ico
#>  create mode 100644 favicons/lc/mstile-144x144.png
#>  create mode 100644 favicons/lc/mstile-150x150.png
#>  create mode 100644 favicons/lc/mstile-310x150.png
#>  create mode 100644 favicons/lc/mstile-310x310.png
#>  create mode 100644 favicons/lc/mstile-70x70.png
#>  create mode 100644 favicons/swc/apple-touch-icon-114x114.png
#>  create mode 100644 favicons/swc/apple-touch-icon-120x120.png
#>  create mode 100644 favicons/swc/apple-touch-icon-144x144.png
#>  create mode 100644 favicons/swc/apple-touch-icon-152x152.png
#>  create mode 100644 favicons/swc/apple-touch-icon-57x57.png
#>  create mode 100644 favicons/swc/apple-touch-icon-60x60.png
#>  create mode 100644 favicons/swc/apple-touch-icon-72x72.png
#>  create mode 100644 favicons/swc/apple-touch-icon-76x76.png
#>  create mode 100644 favicons/swc/favicon-128.png
#>  create mode 100644 favicons/swc/favicon-16x16.png
#>  create mode 100644 favicons/swc/favicon-196x196.png
#>  create mode 100644 favicons/swc/favicon-32x32.png
#>  create mode 100644 favicons/swc/favicon-96x96.png
#>  create mode 100644 favicons/swc/favicon.ico
#>  create mode 100644 favicons/swc/mstile-144x144.png
#>  create mode 100644 favicons/swc/mstile-150x150.png
#>  create mode 100644 favicons/swc/mstile-310x150.png
#>  create mode 100644 favicons/swc/mstile-310x310.png
#>  create mode 100644 favicons/swc/mstile-70x70.png
#>  create mode 100644 fig/introduction-rendered-pyramid-1.png
#>  create mode 100644 images.html
#>  create mode 100644 index.html
#>  create mode 100644 instructor-notes.html
#>  create mode 100644 instructor/CODE_OF_CONDUCT.html
#>  create mode 100644 instructor/LICENSE.html
#>  create mode 100644 instructor/aio.html
#>  create mode 100644 instructor/images.html
#>  create mode 100644 instructor/index.html
#>  create mode 100644 instructor/instructor-notes.html
#>  create mode 100644 instructor/introduction.html
#>  create mode 100644 instructor/key-points.html
#>  create mode 100644 instructor/profiles.html
#>  create mode 100644 introduction.html
#>  create mode 100644 key-points.html
#>  create mode 100644 link.svg
#>  create mode 100644 md5sum.txt
#>  create mode 100644 mstile-150x150.png
#>  create mode 100644 pkgdown.css
#>  create mode 100644 pkgdown.js
#>  create mode 100644 pkgdown.yml
#>  create mode 100644 profiles.html
#>  create mode 100644 renv.lock
#>  create mode 100644 safari-pinned-tab.svg
#>  create mode 100644 site.webmanifest
#>  create mode 100644 sitemap.xml
#> Running git remote -v
#> sandpaper-local	/tmp/RtmpP9eYUD/REMOTE-19323127c1ae (fetch)
#> sandpaper-local	/tmp/RtmpP9eYUD/REMOTE-19323127c1ae (push)
#> Running git push --force sandpaper-local 'HEAD:gh-pages'
#> To /tmp/RtmpP9eYUD/REMOTE-19323127c1ae
#>    3b00149..7057c74  HEAD -> gh-pages
#> ::endgroup::
#> Running git worktree remove --force \
#>   /tmp/RtmpP9eYUD/file1932450c768a/lesson-example/site/docs
#> Running git worktree remove --force \
#>   /tmp/RtmpP9eYUD/file1932450c768a/lesson-example/site/built
tok <- Sys.time()
cli::cli_alert_info("Elapsed time: {round(tok - tik, 2)} seconds")
#>  Elapsed time: 11.94 seconds

# reporting -----
# The repository and remote should both have three branches
cli::cli_h2("Local status")
#> 
#> ── Local status ──
#> 
gert::git_branch_list(repo = res)[c('name', 'commit', 'updated')]
#> # A tibble: 6 × 3
#>   name                       commit                  updated            
#>   <chr>                      <chr>                   <dttm>             
#> 1 gh-pages                   7057c7428761de40f5f195… 2024-07-29 13:14:43
#> 2 main                       b43b0e390e98c3f9578799… 2024-07-29 13:14:32
#> 3 md-outputs                 04d3154447f73f4d22ac65… 2024-07-29 13:14:36
#> 4 sandpaper-local/gh-pages   7057c7428761de40f5f195… 2024-07-29 13:14:43
#> 5 sandpaper-local/main       b43b0e390e98c3f9578799… 2024-07-29 13:14:32
#> 6 sandpaper-local/md-outputs 04d3154447f73f4d22ac65… 2024-07-29 13:14:36

# An indicator this worked: the first episode should be represented as
# different files across the branches:
# - main: Rmd
# - md-outputs: md
# - gh-pages: html
cli::cli_h2("First episode status")
#> ── First episode status ──
#> 
gert::git_stat_files("episodes/introduction.Rmd", repo = rmt)
#> # A tibble: 1 × 5
#>   file             created             modified            commits head 
#> * <chr>            <dttm>              <dttm>                <int> <chr>
#> 1 episodes/introd… 2024-07-29 13:14:32 2024-07-29 13:14:32       1 b43b…
cli::cli_h3("rendered markdown")
#> ── rendered markdown 
gert::git_stat_files("introduction.md", repo = rmt, ref = "md-outputs")
#> # A tibble: 1 × 5
#>   file            created             modified            commits head  
#> * <chr>           <dttm>              <dttm>                <int> <chr> 
#> 1 introduction.md 2024-07-29 13:14:36 2024-07-29 13:14:36       1 04d31…
cli::cli_h3("html file")
#> 
#> ── html file 
gert::git_stat_files("introduction.html", repo = rmt, ref = "gh-pages")
#> # A tibble: 1 × 5
#>   file             created             modified            commits head 
#> * <chr>            <dttm>              <dttm>                <int> <chr>
#> 1 introduction.ht… 2024-07-29 13:14:43 2024-07-29 13:14:43       1 7057…

# CLEAN -------------------------------------------------------------------
tik <- Sys.time()
cli::cli_h1("Clean Up")
#> 
#> ── Clean Up ────────────────────────────────────────────────────────────
snd$remove_local_remote(repo = res)
#> /tmp/RtmpP9eYUD/REMOTE-19323127c1ae
snd$reset_git_user(res)
# remove the test fixture and report
tryCatch(fs::dir_delete(res), error = function() FALSE)
tok <- Sys.time()
cli::cli_alert_info("Elapsed time: {round(tok - tik, 2)} seconds")
#>  Elapsed time: 0.1 seconds