Skip to content

Commit ae6a9fe

Browse files
committed
Added workflow to deploy app on shinyapp.io.
1 parent 960f624 commit ae6a9fe

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy Shiny App to shinyapps.io
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Temporarily move .Rprofile
17+
run: |
18+
if [ -f ".Rprofile" ]; then
19+
mv .Rprofile .Rprofile.bak
20+
fi
21+
22+
- name: Set up R
23+
uses: r-lib/actions/setup-r@v2
24+
25+
- name: Restore renv environment
26+
uses: r-lib/actions/setup-renv@v2
27+
28+
- name: Deploy to shinyapps.io
29+
env:
30+
SHINYAPPSIO_ACCOUNT: ${{ secrets.ACCOUNT }}
31+
SHINYAPPSIO_TOKEN: ${{ secrets.TOKEN }}
32+
SHINYAPPSIO_SECRET: ${{ secrets.SECRET }}
33+
run: |
34+
Rscript -e "rsconnect::setAccountInfo(name='${SHINYAPPSIO_ACCOUNT}', token='${SHINYAPPSIO_TOKEN}', secret='${SHINYAPPSIO_SECRET}')"
35+
Rscript -e "rsconnect::deployApp(appDir = '.', appName = 'load-velocity_model', forceUpdate = TRUE)"

0 commit comments

Comments
 (0)