Closed cderv closed 3 years ago
The current behavior should be that each directory may be specified with an app identifier suffix such as a vanity path, name, or GUID, e.g.:
- name: Publish the book
uses: rstudio/actions/connect-publish@main
with:
api-key: ${{ secrets.RSC_BETA_TOKEN }}
url: https://beta.rstudioconnect.com/
access-type: logged_in
dir: _book:demo-bookdown-deploy
In the case of publishing to an RStudio Connect server where vanity paths may not be changed by users with the publisher
role, the request to update will fail, but publishing will continue. This is the reasoning behind the introduction of require-vanity-path
, which changes the behavior to interrupt publishing when the vanity path cannot be updated. Please reopen if you're still seeing unexpected behavior :grin:
Great, thanks for the addition of require-vanity-path
!
That is indeed working - vanity url is still trying to be set even if app name is provided (not a vanity url) but the request is failing and the deployment continues. I am still getting an error but that is another issue I think.
The issue
As discussed, I am currently testing how to use GHA to deploy some usual R Markdown related project. I am looking at bookdown currently.
I have tested several deployment methods in https://github.com/cderv/deploy-bookdown-demo
When I tried the
connect-publish
action on https://beta.rstudioconnect.com, I can't publish because the action has a prerequisite of the API KEY having the right to set vanity url for a content. And this is not the case by default: https://docs.rstudio.com/connect/admin/appendix/configuration/#Authorization.PublishersCanManageVanitiesThat means, the content is created correctly on RSC but we have an error because the vanity path the action is creating for a new content can't be set. here is the error: https://github.com/cderv/deploy-bookdown-demo/runs/1533824331?check_suite_focus=true#step:9:5530
Discussion about the context and possible solutions
One solution would be to have the setting change on the server, but I don't think that
connect-publish
action should be dependent on a server settingI think this should evolve. I understand main questions are:
The action here tries to deal with both, as the
rsconnect::deployApp()
function. Let's recall that base principle for publishing on connect is (based on the API)And I am guessing you are using that in the action too using the API right ?
About "How to identify a content ? ", AFAIK an app as several identifier
rsconnect::deployApp
or the API when creating a content[ (users/api key) / (name) ]
a unique thing)/content/<id>
)What about those choice for the actions:
rsconnect
package which cache information in dcf in the rsconnect folder. GHA cache could be use the same way - but is it enough reliable ? If this info is lost, the ID or GUID would need to be set manually (related to #11). They are useful for deploying on an existing content though.So at last, maybe not using the vanity url but the app name instead would be enough for the
connect-publish
action. Taking the example in #11I just don't know how easy it would be using the API to find if the content exist. It depends if the name is unique server-wide or account-wide maybe.
Anyway, opening this for discussion. You may have already thoughts on this.