Added workflow to deploy app on shinyapp.io. #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Shiny App to shinyapps.io | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Temporarily move .Rprofile | |
| run: | | |
| if [ -f ".Rprofile" ]; then | |
| mv .Rprofile .Rprofile.bak | |
| fi | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| - name: Restore renv environment | |
| uses: r-lib/actions/setup-renv@v2 | |
| - name: Deploy to shinyapps.io | |
| env: | |
| SHINYAPPSIO_ACCOUNT: ${{ secrets.ACCOUNT }} | |
| SHINYAPPSIO_TOKEN: ${{ secrets.TOKEN }} | |
| SHINYAPPSIO_SECRET: ${{ secrets.SECRET }} | |
| run: | | |
| Rscript -e "rsconnect::setAccountInfo(name='${SHINYAPPSIO_ACCOUNT}', token='${SHINYAPPSIO_TOKEN}', secret='${SHINYAPPSIO_SECRET}')" | |
| Rscript -e "rsconnect::deployApp(appDir = '.', appName = 'load-velocity_model', forceUpdate = TRUE)" |