forked from carpentries-incubator/targets-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (68 loc) · 2.22 KB
/
sandpaper-main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: "01 Build and Deploy Site"
on:
push:
branches:
- main
- master
- l10n_main
schedule:
- cron: '0 0 * * 2'
workflow_dispatch:
inputs:
name:
description: 'Who triggered this build?'
required: true
default: 'Maintainer (via GitHub)'
reset:
description: 'Reset cached markdown files'
required: false
default: false
type: boolean
jobs:
full-build:
name: "Build Full Site"
runs-on: ubuntu-latest
permissions:
checks: write
contents: write
pages: write
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RENV_PATHS_ROOT: ~/.local/share/renv/
steps:
- name: "Checkout Lesson"
uses: actions/checkout@v4
with:
ref: l10n_main
- name: "Set up R"
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
install-r: false
- name: "Set up Pandoc"
uses: r-lib/actions/setup-pandoc@v2
- name: "Setup Lesson Engine"
uses: carpentries/actions/setup-sandpaper@main
with:
cache-version: ${{ secrets.CACHE_VERSION }}
- name: "Setup Package Cache"
uses: carpentries/actions/setup-lesson-deps@main
with:
cache-version: ${{ secrets.CACHE_VERSION }}
- name: Create and populate .Renviron file with LANG_CODE secret
run: |
echo "LANG_CODE=${{ secrets.LANG_CODE }}" >> ~/.Renviron
- name: "Deploy Site"
run: |
reset <- "${{ github.event.inputs.reset }}" == "true"
options(repos = c(carpentries = "https://carpentries.r-universe.dev/", CRAN = "https://cran.rstudio.com/"))
renv::install("carpentries/sandpaper")
renv::install("joelnitta/dovetail")
sandpaper::package_cache_trigger(TRUE)
lesson_trans_dir <- paste0(tempdir(), "/dovetail-", Sys.Date())
lang_code <- Sys.getenv("LANG_CODE", unset = "en")
dovetail:::make_translated_dir(
translated_dir = lesson_trans_dir, overwrite = TRUE, lang = lang_code,
l10n_branch = NULL, clean = FALSE)
sandpaper:::ci_deploy(path = lesson_trans_dir, reset = reset)
shell: Rscript {0}