/
HOWTO_BUILD_WORKSHOP.Rmd
85 lines (56 loc) · 3.77 KB
/
HOWTO_BUILD_WORKSHOP.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
title: "How To Build A Workshop Package"
subtitle: "In other words, how do I use what's here"
author: Sean Davis^[seandavi@gmail.com]
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{How to Use this Package to Build a Bioc Workshop}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
First, this package doesn't do much except add a template Github Action to
build all the pieces necessary for a workshop.
## Quickstart
- [ ] Create a repo from this template and rename it (do not fork the repository).
- [ ] Ensure that "Read and Write Permissions" is checked under [General > Workflow permissions](https://github.com/seandavi/BuildABiocWorkshop/settings/actions).
- [ ] Edit `DESCRIPTION` file
- [ ] Change package name
- [ ] Change title and description
- [ ] Change authors
- [ ] Check dependencies
- [ ] Change DockerImage tag
- [ ] Edit '_pkgdown.yml' (and `.github/workflows yaml file` as needed)
- [ ] Write a normal R package that can be installed
- [ ] Include one or more vignettes that will constitute the workshop materials
## Details
To accomplish this follow each of the 7 steps below. Once your edit the yaml files, Github actions will run each time you commit to github and will create for you:
- the pkgdown website
- the docker image
### 1. Clone this repo
Clone this repo, fork and **rename** it,
OR
(PREFERRED) create a repo from this template
### 2. Edit `DESCRIPTION` file
- Change the package name to something identifiable and descriptive, ideally
something that will be somewhat unique.
- Edit the title and description as per any normal R package.
- Update authors (unless you want me to get credit for your work).
- Workshop packages are normal R packages, so dependencies work as usual. Append libraries to the Depends/Suggests/Imports in this package DESCRIPTION File, which includes;
Depends:
Biobase
Suggests:
knitr,
rmarkdown,
pkgdown
If your packages depend on a github R repos, be sure to specify the correct repo `username/reponame`. Installation will deal with this.
- Edit the last 3 lines of the DESCRIPTION FILE, URL, BugReports and DockerImage (described in more detail below)
### 3. Set up a website (Github Pages)
In your repository, click on settings or url https://github.com/*GITHUB_USERNAME*/*REPO_NAME*/settings. Midway down the page, in the GitHub Pages section, select source 'gh-pages branch'. If only 'master branch' is visible, select master for now, but once Github actions runs, 'gh-pages branch' will be available and is required to render the website.
In the DESCRIPTION file, update the URL: to the website url eg https://seandavi.github.io/BuildABiocWorkshop/ (but substitute your own repo, etc.)
### 4. Edit _pkgdown.yml
Edit the file _pkgdown.yml, updating the url:, title and href: which should be your website url, title of your workshop and github repos url respectively. You do not need to edit this file further. You do not need to add menus or links to vignettes. GitHub Actions and pkgdown will do this when it builds the website
### 5. Edit `.github/workflows yaml` as needed (likely no need)
You do not need to create a docker image manually. Github actions will read Dockerfile located in this template, and using the yaml files will create, build and push to the Github Container Registry an image with the name (default) `ghcr.io/yourgithubuser/yourgithubreponame`, all lowercase.
In the DESCRIPTION file, the **DockerImage: should match your the docker image name (should be lowercase)**.
### 6. Edit README.md, add vignettes to vignettes folder
Edit the README.md. and add one or more Rmd vignettes that will constitute the workshop materials. It is normal R package that should pass `rcmdcheck::rcmdcheck()`, and be installed using regular R package install commands.