-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (48 loc) · 2.03 KB
/
deploy_shiny_r2u.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
name: Deploy to shinyapps.io
on:
# run on any push
push:
# run on request (via button in actions menu)
workflow_dispatch:
env:
_R_CHECK_FORCE_SUGGESTS_: "false"
jobs:
deploy:
name: Deploy to shinyapps
# allow skipping deployment for commits containing '[automated]' or '[no-deploy]' in the commit message
if: "!contains(github.event.head_commit.message, '[automated]') && !contains(github.event.head_commit.message, '[no-deploy]')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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: Push to shiny.io
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
Rscript -e "
install.packages(c('rsconnect', 'remotes'));
bspm::disable();
remotes::install_github('forrtproject/FReD', force = TRUE);
rsconnect::setAccountInfo(name='forrt-replications', token=${{secrets.SHINYAPPS_TOKEN}}, secret=${{secrets.SHINYAPPS_SECRET}});
appDir <- system.file('fred_explorer', package = 'FReD');
rsconnect::deployApp(appDir, forceUpdate = TRUE);
appDir <- system.file('fred_annotator', package = 'FReD');
rsconnect::deployApp(appDir, forceUpdate = TRUE);
"
- name: Deploy release version conditionally
if: github.event_name == 'release' && github.event.release.tag_name != '*test*'
run: |
R -e "
appDir <- system.file('fred_explorer', package = 'FReD');
rsconnect::deployApp(appName = 'fred_explorer_release', appDir, forceUpdate = TRUE);
appDir <- system.file('fred_annotator', package = 'FReD');
rsconnect::deployApp(appName = 'fred_annotator_release', appDir, forceUpdate = TRUE);
"