use constants for events/meac/p response names (#243) #93
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
| # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | |
| # see https://www.tidyverse.org/blog/2022/06/actions-2-0-0/ for info on setup-r-dependencies@v2 | |
| on: | |
| push: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| name: Deployment Production | |
| jobs: | |
| deployment-production: | |
| runs-on: ubuntu-24.04 | |
| environment: | |
| name: production | |
| url: https://stanpumpr.io | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-pandoc@v2 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: 'renv' | |
| use-public-rspm: true | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libpng-dev | |
| - uses: r-lib/actions/setup-renv@v2 | |
| - name: Install stanpumpR from GitHub | |
| run: | | |
| pkg_ref <- "${{ github.repository }}" | |
| remotes::install_github(pkg_ref, upgrade = "never", force = TRUE) | |
| find.package("stanpumpR") # force a failure if package didn't install so GHA won't continue | |
| shell: Rscript {0} | |
| - name: Remove renv lockfile | |
| run: sudo rm renv.lock # now that all pacakges have correct versions, remove lockfile | |
| # because deployApp() will fail if it sees this lockfile | |
| # see https://github.com/rstudio/rsconnect/issues/1315 | |
| - name: Authorize and deploy app | |
| run: | | |
| shinyConfig <- list( | |
| default = list( | |
| email_username = "${{ secrets.SHINY_CONFIG_EMAIL_USERNAME }}", | |
| email_password = "${{ secrets.SHINY_CONFIG_EMAIL_PASSWORD }}", | |
| debug = 0 | |
| ) | |
| ) | |
| yaml::write_yaml(shinyConfig, "config.yml", fileEncoding = "UTF-8") | |
| rsconnect::setAccountInfo("${{ vars.SHINY_ACCOUNT }}", "${{ secrets.SHINY_TOKEN }}", "${{ secrets.SHINY_SECRET }}") | |
| rsconnect::deployApp( | |
| appName = "${{ vars.SHINY_APP_NAME }}", account = "${{ vars.SHINY_ACCOUNT }}", | |
| appDir = ".", appFiles = c("app.R", "config.yml"), forceUpdate = TRUE | |
| ) | |
| shell: Rscript {0} |