Skip to content
76 changes: 50 additions & 26 deletions examples/README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Package workflows:
- [`lint`](#lint-workflow) - Run `lintr::lint_package()` on an R package.
- [`pr-commands`](#commands-workflow) - Adds `/document` and `/style` commands for pull requests.
- [`pkgdown`](#build-pkgdown-site) - Build a [pkgdown] site for an R package and deploy it to [GitHub Pages].
- [`document`](#document-package) - Run `roxygen2::roxygenise()` on an R package.
- [`style`](#style-package) - Run `styler::style_pkg()` on an R package.

RMarkdown workflows:

Expand Down Expand Up @@ -142,16 +144,6 @@ package.
print_yaml("pr-commands.yaml")
```

## Render Rmarkdown

`usethis::use_github_action("render-rmarkdown")`

This example automatically re-builds any Rmarkdown file in the repository whenever it changes and commits the results to the same branch.

```{r echo = FALSE, results = "asis"}
print_yaml("render-rmarkdown.yaml")
```

## Build pkgdown site

`usethis::use_github_action("pkgdown")`
Expand All @@ -164,6 +156,38 @@ The inclusion of [`workflow_dispatch`](https://docs.github.com/en/actions/learn-
print_yaml("pkgdown.yaml")
```

## Document package

`usethis::use_github_action("document")`

This example documents an R package whenever a file in the `R/` directory changes, then commits and pushes the changes
to the same branch.

```{r echo = FALSE, results = "asis"}
print_yaml("document.yaml")
```

## Style package

`usethis::use_github_action("document")`

This example styles the R code in a package, then commits and pushes the changes
to the same branch.

```{r echo = FALSE, results = "asis"}
print_yaml("style.yaml")
```

## Render Rmarkdown

`usethis::use_github_action("render-rmarkdown")`

This example automatically re-builds any Rmarkdown file in the repository whenever it changes and commits the results to the same branch.

```{r echo = FALSE, results = "asis"}
print_yaml("render-rmarkdown.yaml")
```

## Build bookdown site

`usethis::use_github_action("bookdown")`
Expand All @@ -190,22 +214,6 @@ You will need to run `renv::snapshot()` locally and commit the `renv.lock` file
print_yaml("blogdown.yaml")
```

## Shiny App Deployment

`usethis::use_github_action("shiny-deploy")`

This example will deploy your Shiny application to either [shinyapps.io](https://www.shinyapps.io/) or [RStudio Connect](https://www.rstudio.com/products/connect/) using the `rsconnect` package. The `rsconnect` package requires authorization to deploy an app using your account. This action does this by using your user name (`RSCONNECT_USER`), token (`RSCONNECT_TOKEN`), and secret (`RSCONNECT_SECRET`), which are securely accessed as GitHub Secrets. **Your token and secret are private and should be kept confidential**.

This action assumes you have an `renv` lockfile in your repository that describes the `R` packages and versions required for your Shiny application.

- See here for information on how to obtain the token and secret for configuring `rsconnect`: https://shiny.rstudio.com/articles/shinyapps.html

- See here for information on how to store private tokens in a repository as GitHub Secrets: https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository

```{r echo = FALSE, results = "asis"}
print_yaml("shiny-deploy.yaml")
```

## Docker based workflow

`usethis::use_github_action("docker")`
Expand Down Expand Up @@ -257,6 +265,22 @@ This example uses the [lintr](https://github.com/jimhester/lintr) package to lin
print_yaml("lint-project.yaml")
```

## Shiny App Deployment

`usethis::use_github_action("shiny-deploy")`

This example will deploy your Shiny application to either [shinyapps.io](https://www.shinyapps.io/) or [RStudio Connect](https://www.rstudio.com/products/connect/) using the `rsconnect` package. The `rsconnect` package requires authorization to deploy an app using your account. This action does this by using your user name (`RSCONNECT_USER`), token (`RSCONNECT_TOKEN`), and secret (`RSCONNECT_SECRET`), which are securely accessed as GitHub Secrets. **Your token and secret are private and should be kept confidential**.

This action assumes you have an `renv` lockfile in your repository that describes the `R` packages and versions required for your Shiny application.

- See here for information on how to obtain the token and secret for configuring `rsconnect`: https://shiny.rstudio.com/articles/shinyapps.html

- See here for information on how to store private tokens in a repository as GitHub Secrets: https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository

```{r echo = FALSE, results = "asis"}
print_yaml("shiny-deploy.yaml")
```


## Forcing binaries

Expand Down
Loading