-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.69 KB
/
main.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
name: Render and Deploy All Quarto Documents
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
render:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.MY_GITHUB_PAT }}
steps:
- uses: actions/checkout@v4
- name: Set up R
uses: r-lib/actions/setup-r@v2
# - name: Install R dependencies
# uses: r-lib/actions/setup-r-dependencies@v2
# with:
# cache-version: 2
# extra-packages: |
# any::ggplot2
# any::rcmdcheck
# any::remotes
# any::rmarkdown
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Install specific R packages
run: |
Rscript -e 'install.packages(c("rmarkdown", "ggplot2", "remotes"))'
Rscript -e 'remotes::install_github("tensorchiefs/data", subdir = "R/edudat", dependencies = TRUE, upgrade = "always", verbose = TRUE)'
- name: Render QMD files
run: |
quarto render data/*.qmd --to gfm
- name: Commit and push rendered files to docs branch
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git checkout docs
cp -r data/* .
git add .
git commit -m 'Update rendered documentation'
git push origin docs
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_PAT }}
# Optional deployment step, commented out for now
# - name: Deploy to GitHub Pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# personal_token: ${{ secrets.MY_GITHUB_PAT }}
# publish_dir: ./data
# publish_branch: gh-docs