How to deploy to RStudio Connect from a GtiHub Actions workflow

Apologies if I misquoted, you need both setAccountInfo and addConnectServer. One registers the server in the environment and the other one "sets" the account info. I also made a small modification to your URL in the addConnectServer function. I include an example below. Hope you now have a successful deployment!

      - name: Register RStudio Connect Server
        run: |
           rsconnect::addConnectServer(
            url = "https://rstudio-connect.REDACTED.com",
            name = "connect",
            quiet = TRUE
          )
         shell: Rscript {0}
      - name: Register RStudio Connect Account
         run: |
          rsconnect::setAccountInfo(
            name = Sys.getenv("RSCONNECTNAME"),    # registered as a secret in GitHub settings
            token = Sys.getenv("RSCONNECTTOKEN"),  # registered as a secret in GitHub settings
            secret = Sys.getenv("RSCONNECTSECRET") # registered as a secret in GitHub settings
          )
        shell: Rscript {0}
      - name: Deploy site
        run: |
          withr::with_dir(
            "docs",
            rsconnect::deployApp(
              appDir = ".",
              appFiles = list.files(".", recursive = TRUE, all.files = TRUE),
              appPrimaryDoc = "index.html",
              appId = REDACTED,
              appName = REDACTED,
              appTitle = REDACTED,
              account = Sys.getenv("RSCONNECTNAME"), # registered as a secret in GitHub settings
              server = "connect"
            )
          )
        shell: Rscript {0}
1 Like