-
Notifications
You must be signed in to change notification settings - Fork 1
117 lines (93 loc) · 3.32 KB
/
ci.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Run CI for R using https://eddelbuettel.github.io/r-ci/
name: ci
on:
push:
pull_request:
env:
_R_CHECK_FORCE_SUGGESTS_: "false"
jobs:
document-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- name: Setup
uses: eddelbuettel/github-actions/r-ci-setup@master
- name: Bootstrap
run: ./run.sh bootstrap
#- name: Dependencies
# run: ./run.sh install_deps
- name: All Dependencies
run: ./run.sh install_all
- name: Create documentation
run: |
R -e "
install.packages(c('rcmdcheck', 'roxygen2', 'devtools'));
file.remove('NAMESPACE');
descr <- readLines('DESCRIPTION');
descr <- stringr::str_replace(descr, '^Date.*$', paste('Date:', Sys.Date()));
writeLines(descr, 'DESCRIPTION');
roxygen2::roxygenise();
try(devtools::build_manual())
"
- name: commit
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add -f man/\* NAMESPACE
git commit -m 'Documentation' || echo "No changes to commit"
git push origin || echo "No changes to commit"
- name: Deploy
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
R -e "
install.packages(c('rsconnect', 'remotes'));
bspm::disable();
remotes::install_github('ESHackathon/CiteSource', force = TRUE);
rsconnect::setAccountInfo(name=${{secrets.SHINY_LUKAS_ACCOUNT}}, token=${{secrets.SHINY_LUKAS_TOKEN}}, secret=${{secrets.SHINY_LUKAS_SECRET}});
rsconnect::deployApp(appName = 'CiteSource_latest', appDir = './inst/shiny-app/CiteSource', forceUpdate = TRUE)"
- name: Deploy release version conditionally
if: github.event_name == 'release' && github.event.release.tag_name != '*test*'
run: |
R -e "
rsconnect::deployApp(appName = 'CiteSource', appDir = './inst/shiny-app/CiteSource', forceUpdate = TRUE)"
- name: Create pkgdown
run: |
R -e "
install.packages('pkgdown');
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)"
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: true
branch: gh-pages
folder: docs
R-CMD-check:
if: ${{ always() }}
needs: document-and-deploy
strategy:
matrix:
include:
- {os: macOS-latest}
- {os: ubuntu-latest}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- name: Setup
uses: eddelbuettel/github-actions/r-ci-setup@master
- name: Bootstrap
run: ./run.sh bootstrap
- name: Install rcmdcheck
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
R -e "
install.packages(c('rcmdcheck', 'devtools'));
devtools::install_local()
"
- uses: r-lib/actions/check-r-package@v2