Skip to content

Commit 06cc13b

Browse files
committed
Add a polished README and logo
1 parent fec6d70 commit 06cc13b

File tree

9 files changed

+425
-77
lines changed

9 files changed

+425
-77
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
^LICENSE\.md$
44
^.devcontainer$
55
^.github$
6+
^README\.Rmd$
7+
^\.github$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
R-CMD-check:
14+
runs-on: ubuntu-latest
15+
env:
16+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
17+
R_KEEP_PKG_SOURCE: yes
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: r-lib/actions/setup-r@v2
22+
with:
23+
use-public-rspm: true
24+
25+
- uses: r-lib/actions/setup-r-dependencies@v2
26+
with:
27+
extra-packages: any::rcmdcheck
28+
needs: check
29+
30+
- uses: r-lib/actions/check-r-package@v2
31+
with:
32+
upload-snapshots: true
33+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/pre-build-devcontainer.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
.Rhistory
33
.RData
44
.Ruserdata
5+
inst/doc
6+
.DS_Store

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ Suggests:
2424
knitr,
2525
rmarkdown
2626
Config/testthat/edition: 3
27+
VignetteBuilder: knitr

README.Rmd

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
---
2+
output: github_document
3+
---
4+
5+
<!-- README.md is generated from README.Rmd. Please edit that file -->
6+
7+
```{r}
8+
#| include: FALSE
9+
knitr::opts_chunk$set(
10+
collapse = TRUE,
11+
comment = "#>",
12+
fig.path = "man/figures/README-",
13+
out.width = "100%"
14+
)
15+
```
16+
17+
# multideploy <img src="man/figures/multideploy-logo.svg" align="right" height="139" />
18+
19+
<!-- badges: start -->
20+
[![R-CMD-check](https://github.com/coatless-rpkg/multideploy/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/coatless-rpkg/multideploy/actions/workflows/R-CMD-check.yaml)
21+
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
22+
<!-- badges: end -->
23+
24+
## Overview
25+
26+
The `multideploy` package provides tools for deploying file changes across multiple GitHub repositories. It's designed to help you manage standardized configurations, CI/CD workflows, and other common files that need to be synchronized across multiple repositories.
27+
28+
## Installation
29+
30+
You can install the development version of `multideploy` from [GitHub](https://github.comcoatless-rpkg/multideploy) with:
31+
32+
```r
33+
# install.packages("remotes")
34+
remotes::install_github("coatless-rpkg/multideploy")
35+
```
36+
37+
## Authentication
38+
39+
`multideploy` uses the [`gh`](https://github.com/r-lib/gh) package for
40+
GitHub API authentication and querying. Before using `multideploy`, make sure
41+
you have a GitHub Personal Access Token (PAT) set up:
42+
43+
```r
44+
# Set GitHub PAT (or use .Renviron)
45+
Sys.setenv(GITHUB_PAT = askpass::askpass("What is your GitHub Personal Access Token (PAT)?"))
46+
```
47+
48+
It's recommended to store your PAT in your `.Renviron` file rather than in your code.
49+
50+
## Quick Start Example
51+
52+
Here's an example showing how to deploy a standardized CI workflow file to multiple repositories using `multideploy`:
53+
54+
```{r}
55+
#| label: quick-example
56+
#| eval: false
57+
library(multideploy)
58+
59+
# List repositories in an organization matching a pattern
60+
repos <- repos("my-organization", filter_regex = "^api-")
61+
62+
# Deploy a CI workflow file to the selected repositories
63+
results <- file_deploy(
64+
source_file = "templates/check-standard.yml",
65+
target_path = ".github/workflows/R-CMD-check.yaml",
66+
repos = repos
67+
)
68+
69+
# View results
70+
print(results)
71+
```
72+
73+
> [!IMPORTANT]
74+
>
75+
> The GitHub PAT used for authentication must have the necessary permissions to
76+
> access and modify the repositories' workflows.
77+
78+
## Extended Overview
79+
80+
If you're looking for more detailed examples on how to use `multideploy`, we
81+
step through the additional features of the package within this section.
82+
83+
### Repository Selection
84+
85+
List and filter repositories across users or organizations:
86+
87+
```{r}
88+
#| label: repo-listing
89+
#| eval: false
90+
# Get all public repositories for a user
91+
user_repos <- repos("username", type = "public")
92+
93+
# Get repositories for an organization matching a pattern
94+
org_repos <- repos("orgname", filter_regex = "^data-")
95+
96+
# List organizations you have access to
97+
my_orgs <- orgs()
98+
```
99+
100+
### File Deployment
101+
102+
Deploy individual files or sets of files to multiple repositories:
103+
104+
```{r}
105+
#| label: file-deploy
106+
#| eval: false
107+
# Deploy a single file
108+
file_deploy("local/path/file.R", "remote/path/file.R", repos)
109+
110+
# Create a mapping of multiple files
111+
mapping <- file_mapping(
112+
"local/lint.R" = ".lintr",
113+
"local/gitignore" = ".gitignore",
114+
dir = "templates/workflows",
115+
pattern = "\\.ya?ml$",
116+
target_prefix = ".github/workflows/"
117+
)
118+
119+
# Create pull requests with multiple file changes
120+
pr_create(
121+
repos = repos,
122+
branch_name = "feature/standardize-workflows",
123+
title = "Standardize CI workflows",
124+
body = "Implements organization-wide CI workflow standards",
125+
file_mapping = mapping
126+
)
127+
```
128+
129+
### Dry Run Mode
130+
131+
Preview changes before making them:
132+
133+
```{r}
134+
#| label: dry-run
135+
#| eval: false
136+
# Preview changes without making them
137+
file_deploy("local/file.R", "remote/file.R", repos, dry_run = TRUE)
138+
139+
# Preview PR creation
140+
pr_create(repos, "branch-name", "PR Title", "PR Body", mapping, dry_run = TRUE)
141+
```
142+
143+
## License
144+
145+
AGPL (>= 3)

0 commit comments

Comments
 (0)