-
Notifications
You must be signed in to change notification settings - Fork 54
81 lines (69 loc) · 2.65 KB
/
quarto.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
77
78
79
80
81
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
name: quarto
jobs:
build:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
isExtPR: ${{ github.event.pull_request.head.repo.fork == true }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: 1.5.56
- name: Install system dependencies
run: brew install pandoc harfbuzz freetype2 fribidi
- name: Install Google Fonts
run: |
brew install font-open-sans
- name: Query dependencies
run: |
options(repos = 'https://packagemanager.rstudio.com/all/latest')
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Cache R packages
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ hashFiles('.github/R-version') }}-2-
- name: Configure Git user
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
- name: Install Package Dependencies
run: |-
options(repos = 'https://packagemanager.rstudio.com/all/latest')
install.packages('remotes')
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
- name: Deploy to Netlify
if: contains(env.isExtPR, 'false')
id: netlify-deploy
uses: nwtgck/[email protected]
with:
publish-dir: './_book'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message:
'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})'
# these all default to 'true'
enable-pull-request-comment: false
enable-commit-comment: false
# enable-commit-status: true
# overwrites-pull-request-comment: true
timeout-minutes: 1