1
+ name : Deploy Shiny App to shinyapps.io
2
+
1
3
on :
2
4
push :
3
- branches :
4
- - main
5
-
6
- name : Deploy template app to shinyapps.io
5
+ branches :
6
+ - main # Trigger when code is pushed to main branch
7
7
8
8
jobs :
9
- deploy-shiny :
10
- name : Deploy to shinyapps.io
11
- runs-on : ubuntu-latest
12
- env :
13
- GITHUB_PAT : ${{ secrets.ACCESS_TOKEN }}
14
- ACCESS_TOKEN : ${{ secrets.ACCESS_TOKEN }}
15
-
9
+ deploy :
10
+ name : Publish to shinyapps.io
11
+ runs-on : ubuntu-latest # Use the latest Ubuntu image
12
+
16
13
steps :
17
- - name : 🛎️ Checkout repository
18
- uses : actions/checkout@v4
19
- with :
20
- fetch-depth : 0
21
- - id : deploy
22
- name : 💎 Deploy to shinyapps.io
23
- uses : qwert666/shinyapps-actions@main
24
- env :
25
- SHINY_USERNAME : ${{ secrets.SHINYAPPS_ACCOUNT }}
26
- SHINY_TOKEN : ${{ secrets.SHINYAPPS_TOKEN }}
27
- SHINY_SECRET : ${{ secrets.SHINYAPPS_SECRET }}
28
- APP_NAME : ' markov_example'
29
-
14
+ # Step 1: Checkout the repository
15
+ - name : Checkout code
16
+ uses : actions/checkout@v4
17
+
18
+ # Step 2: Set up R environment
19
+ - name : Set up R
20
+ uses : r-lib/actions/setup-r@v2
21
+
22
+ # Step 3: Install rsconnect and dependencies
23
+ - name : Install rsconnect and dependencies
24
+ run : |
25
+ R -e 'install.packages("rsconnect")'
26
+
27
+ # Step 4: Deploy the Shiny app
28
+ - name : Deploy app to shinyapps.io
29
+ env :
30
+ SHINYAPPS_ACCOUNT : ${{ secrets.SHINYAPPS_ACCOUNT }}
31
+ SHINYAPPS_TOKEN : ${{ secrets.SHINYAPPS_TOKEN }}
32
+ SHINYAPPS_SECRET : ${{ secrets.SHINYAPPS_SECRET }}
33
+ run : |
34
+ R -e 'rsconnect::setAccountInfo(name="${{ secrets.SHINYAPPS_ACCOUNT }}", token="${{ secrets.SHINYAPPS_TOKEN }}", secret="${{ secrets.SHINYAPPS_SECRET }}")'
35
+ R -e 'rsconnect::deployApp(appDir = ".", appName = "YOUR_APP_NAME")'
0 commit comments