BDSI-Utwente / shinyapps-deploy-github-action

MIT License
12 stars 13 forks source link

Added flag to enable forced update of existing apps #3

Open h-joshi opened 6 months ago

h-joshi commented 6 months ago

Added a flag that enables forced update for already installed apps. Without this flag, the deployment fails if an app with the same name already exists.

andrewbowen19 commented 2 months ago

Wanted to give a +1 to this PR! Love the action, though I'm running into a deployment error with an app of the same name when using it!

h-joshi commented 2 months ago

Wanted to give a +1 to this PR! Love the action, though I'm running into a deployment error with an app of the same name when using it!

Could you paste a screenshot of the error or any logs? I've been using this in my CI/CD pipeline without issues. Happy to update the PR if there's something amiss.

andrewbowen19 commented 2 months ago

Hi there @h-joshi , posting some logs from a failed action I tried to run on my branch:

- Installing feasts ...                         OK [installed binary and cached in 1.2s]
- Installing shinyjs ...                        OK [installed binary and cached in 0.45s]
- Installing colourpicker ...                   OK [installed binary and cached in 0.68s]
- Installing ggExtra ...                        OK [installed binary and cached in 0.66s]
- Installing gridExtra ...                      OK [installed binary and cached in 0.61s]
- Installing urca ...                           OK [installed binary and cached in 0.52s]
checking account info... [OK]
── Preparing for deployment ────────────────────────────────────────────────────
Error in `rsconnect::deployApp()`:
! Discovered a previously deployed app named "REMSDashboard"
(View it at <https://scmn6p-andrew-bowen.shinyapps.io/REMSDashboard/>)
ℹ Set `forceUpdate = TRUE` to update it.
ℹ Supply a unique `appName` to deploy a new application.
Backtrace:
    ▆
 1. └─rsconnect::deployApp(...)
 2.   └─rsconnect:::findDeploymentTarget(...)
 3.     └─rsconnect:::findDeploymentTargetByAppName(...)
 4.       └─rsconnect:::shouldUpdateApp(...)
 5.         └─rsconnect:::cli_menu(...)
 6.           └─cli::cli_abort(c(header, not_interactive), .envir = .envir, call = error_call)
 7.             └─rlang::abort(...)
Execution halted
h-joshi commented 2 months ago

Hi @andrewbowen19

This PR hasn't been integrated into this repository yet.

As a result I've had to fork this to https://github.com/kidsneuro-lab/shinyapps-deploy-github-action/tree/forceupdate-flag-added . At present, I'm using this action kidsneuro-lab/shinyapps-deploy-github-action@forceupdate-flag-added currently which has the forceUpdate flag implemented.

Before

        uses: BDSI-Utwente/shinyapps-deploy-github-action@v1
        with:
          # account and application name (https://<accountName>.shinyapps.io/<appName>)
          appName: REMSDashboard
          accountName: scmn6p-andrew-bowen

          # token and secret obtained from https://www.shinyapps.io/admin/#/tokens
          accountToken: ${{ secrets.SHINYAPPS_TOKEN }}
          accountSecret: ${{ secrets.SHINYAPPS_SECRET }}

After

        uses: kidsneuro-lab/shinyapps-deploy-github-action@forceupdate-flag-added
        with:
          # account and application name (https://<accountName>.shinyapps.io/<appName>)
          appName: REMSDashboard
          accountName: scmn6p-andrew-bowen

          # token and secret obtained from https://www.shinyapps.io/admin/#/tokens
          accountToken: ${{ secrets.SHINYAPPS_TOKEN }}
          accountSecret: ${{ secrets.SHINYAPPS_SECRET }}

          # force update if app with same name is already deployed
          forceUpdate: true