Skip to content

Commit 8e809b3

Browse files
committed
Add a DESCRIPTION file to install dependencies on the GitHub action runner due to a change between shinylive 0.2.0 and shinylive 0.3.0 requiring the R package to physically be installed.
1 parent ffe2fdb commit 8e809b3

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

.github/workflows/build-and-deploy-shinylive-r-app.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ jobs:
3333
uses: r-lib/actions/setup-r-dependencies@v2
3434
with:
3535
packages:
36-
36+
cran::[email protected] ## Pin version to ensure consistency
37+
local::. ## Install required dependencies
38+
## Required for shinylive >= 0.3.0
3739

3840
# Export the current working directory as the shiny app
3941
# using the pinned version of the Shinylive R package

DESCRIPTION

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Package: shinyliveconvertdemo
2+
Title: Demo converting an R Shiny application to Shinylive
3+
Version: 0.0.1
4+
Authors@R: c(
5+
person("James Joseph", "Balamuta",
6+
email = "[email protected]",
7+
role = c("aut", "cre"),
8+
comment = c(ORCID = "0000-0003-2826-8458")
9+
)
10+
)
11+
Description: List the package dependencies here for the GitHub action to automatically
12+
include the packages on the build. This is required for r-shinylive version >= 0.3.0.
13+
URL: https://tutorials.thecoatlessprofessor.com/convert-shiny-app-r-shinylive/, https://github.com/coatless-tutorials/convert-shiny-app-r-shinylive
14+
BugReports: https://github.com/coatless-tutorials/convert-shiny-app-r-shinylive/issues
15+
License: MIT + file LICENSE
16+
Depends: R (>= 4.4)
17+
Imports:
18+
shiny,
19+
shinythemes
20+
Encoding: UTF-8

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,31 @@ For this to work, we're advocating for a repository structure of:
7777
│ └── workflows
7878
│ └── build-and-deploy-shinylive-r-app.yml
7979
├── README.md
80+
├── DESCRIPTION
8081
└── app.R
8182
```
8283

83-
The source for the R Shiny app can be placed into the [`app.R`](app.R) file and, then, use the following GitHub Action in `.github/workflows/build-and-deploy-shinylive-r-app.yml` to build and deploy the shinylive app every time the repository is updated.
84+
The source for the R Shiny app can be placed into the [`app.R`](app.R) file,
85+
the DESCRIPTION file can be used to specify the dependencies of the app,
86+
and, then, use the following GitHub Action in `.github/workflows/build-and-deploy-shinylive-r-app.yml` to build and deploy the shinylive app every time the repository is updated.
87+
88+
## DESCRIPTION File
89+
90+
The DESCRIPTION file is used to specify the dependencies of the app. For the
91+
example app, the DESCRIPTION file is as follows:
92+
93+
```default
94+
Package: shinyliveconvertdemo
95+
Title: Demo converting an R Shiny application to Shinylive
96+
Version: 0.0.1
97+
Description: List the package dependencies here for the GitHub action to automatically
98+
include the packages on the build. This is required for r-shinylive version >= 0.3.0.
99+
Imports:
100+
shiny,
101+
shinythemes
102+
Encoding: UTF-8
103+
```
104+
84105

85106
## GitHub Action Workflow for Converting and Deploying
86107

@@ -124,6 +145,8 @@ jobs:
124145
with:
125146
packages:
126147
cran::[email protected] ## Pin version to ensure consistency
148+
local::. ## Install required dependencies
149+
## Required for shinylive >= 0.3.0
127150

128151
# Export the current working directory as the shiny app
129152
# using the pinned version of the Shinylive R package

0 commit comments

Comments
 (0)