-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.42 KB
/
publish.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
name: Quarto Publish
on:
push:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 23 * * *' # Optional: Daily at 11 PM
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
env:
RUST_BACKTRACE: 1 # Optional: For detailed error reporting
steps:
# 1. Check out the repository
- name: Check out repository
uses: actions/checkout@v4
# 2. Set up R with RSPM for faster package installations
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
# 3. Cache renv dependencies
- name: Cache renv dependencies
uses: actions/cache@v3
with:
path: |
renv/library
renv/cache
key: ${{ runner.os }}-renv-${{ hashFiles('renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
# 4. Install renv
- name: Install renv
run: |
install.packages("renv")
# 5. Restore renv environment
- name: Restore renv Environment
run: |
renv::restore()
# 6. Set up Quarto
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
# 7. Render and Publish
- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}