3 CI/CD pypelines for automatic deployment of a R Shiny web app

It is good practice to integrate and develop an R Shiny app as an R package, to take full advantage of all the integrated features established for R packages (e.g., documentation, package namespaces, automated testing, R CMD check, etc.). A typical development workflow to package a Shiny app is provided by the golem package. Furthermore, version control systems such as Git are a great asset for keeping track an manage changes, especially in a collaborative setup.

The development od packaged Shiny app under version control can easily enable and take advantage of:

  • Continuous Integration (CI) pipelines to automate checks and ensure higher code quality and robustness;
  • Continuous Deployment (CD) pipelines to automate the process of deployment to a productive environment.

This guide is illustrates how to set up CI/CD pipelines on the popular free and open source services Travis CI and GitHub Actions for a packaged Shiny app on GitHub repository, deployed and hosted on shinyapps.io. ShinyCICD is a minimal example of a packaged Shiny app that will be used as an example throughout the guide. You can simply fork the repository and setup your specific user settings (especially for shinyapps.io) to see CI/CD pipelines in actions, or follow the steps described below to setup CI/CD pipelines for your own app.