-
Notifications
You must be signed in to change notification settings - Fork 56
64 lines (53 loc) · 2.26 KB
/
render_book_on_pr.yml
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
name: Render Book on PR to Main
on:
pull_request_target:
types: [closed]
branches:
- main
jobs:
check-merged:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'handbook_update')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
build-and-render:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'handbook_update')
runs-on: ubuntu-latest
needs: [check-merged] # Ensure this runs only after the check-merged job completes
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
tinytex: false
# uncomment and specify version if needed
# version: SPECIFIC-QUARTO-VERSION-HERE
- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Restore R package from renv
run: |
install.packages("renv")
renv::restore()
# Rscript -e '
# if (!requireNamespace("pacman", quietly = TRUE)) install.packages("pacman")
# pacman::p_load(
# "tidyverse", "googlesheets4", "learnr", "swirl", "here", "rio", "openxlsx",
# "pacman", "renv", "remotes", "linelist", "naniar", "janitor", "gtsummary",
# "rstatix", "broom", "lmtest", "easystats", "epicontacts", "EpiNow2",
# "EpiEstim", "projections", "incidence2", "i2extras", "epitrix", "distcrete",
# "cowplot", "RColorBrewer", "ggnewscale", "DiagrammeR", "gghighlight", "ggrepel",
# "plotly", "gganimate", "sf", "tmap", "OpenStreetMap", "spdep", "rmarkdown",
# "reportfactory", "officer", "flexdashboard", "shiny", "knitr", "flextable",
# "ggtree", "ape", "treeio", "babelquarto", "babeldown")'
- name: Render Book
run: Rscript -e 'source("quarto_runfile.R")'
- name: Publish to Netlify (and render)
uses: quarto-dev/quarto-actions/publish@v2
with:
target: netlify
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}