Skip the tutorial and publish the example now
Publish a Quarto Document with R to Connect Cloud
This guide builds a Quarto document using R and deploys it to Posit Connect Cloud. Code for the project is available on GitHub.
1. Create a new GitHub repository
Sign in to GitHub and create a new, public repository.
2. Start a new RStudio project
In RStudio:
- Click New Project from the File menu
- Select Version Control
- Select Git
- Paste the URL to your repository in the Repository URL field
- Enter a Desired Project directory name
- Confirm or change the subdirectory location
Now that your project is synced with your GitHub repository, you are ready to begin coding.
From the New File dropdown or the New File option from the File menu:
- Select Quarto Document
- Uncheck the Use visual markdown editor checkbox
- Click Create Empty Document
- Save the file as
report.qmd
Build the document
Replace the content in report.qmd
with the code in this file.
Preview the document
In RStudio when looking at report.qmd
, click the Render button. Depending on your Format Options, you will see a local preview of the document either in the Viewer pane or a new browser tab.
Add dependency file
The last thing you need to do is create a dependency file that will provide Connect Cloud with enough information to rebuild your content during deployment. Although there are multiple approaches to achieve this, Connect Cloud exclusively uses a manifest.json file.
To create this file, load the rsconnect
library and run the writeManifest()
function.
rsconnect::writeManifest()
This function creates a .json file named manifest.json
that will tell Connect Cloud (1) what version of R to use and (2) what packages and versions are required.
3. Push to GitHub
Now that everything looks good and we’ve created a file to help reproduce your local environment, it is time to get the code on GitHub.
- Navigate to the Git tab in your RStudio project
- Click Commit
- Select the checkbox to stage each new or revised file
- Enter a commit message
- Click Commit
- Click the Push icon
Your repository now has everything it needs for Connect Cloud.
4. Deploy to Posit Connect Cloud
Follow the steps below to deploy your project to Connect Cloud.
Sign in to Connect Cloud.
Click the Publish icon button on the top of your Profile page
Select Quarto
Select the public repository that you created in this tutorial
Confirm the branch
Select report.qmd as the primary file
Click Publish
Publishing will display status updates during the deployment process. You will also find build logs streaming on the lower part of the screen.
Congratulations! You successfully deployed to Connect Cloud and are now able to share the link with others.
5. Republish the application
If you update the code to your application or the underlying data source, commit and push the changes to your GitHub repository.
Once the repository has the updated code, you can republish the application on Connect Cloud by going to your Content List and clicking the republish icon.