Skip to content

Commit fb94139

Browse files
committed
Initial commit
0 parents  commit fb94139

File tree

14 files changed

+448
-0
lines changed

14 files changed

+448
-0
lines changed

.Rbuildignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
^LICENSE\.md$
2+
.github
3+
Dockerfile
4+
_pkgdown.yml
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
on: [push, pull_request]
2+
3+
env:
4+
cache-version: v1
5+
repo-name: seandavi/buildabiocworkshop
6+
7+
jobs:
8+
job1:
9+
runs-on: ubuntu-latest
10+
container: bioconductor/bioconductor_docker:devel
11+
steps:
12+
- uses: actions/checkout@v1
13+
14+
- name: Query dependencies and update old packages
15+
run: |
16+
BiocManager::install(ask=FALSE)
17+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
18+
shell: Rscript {0}
19+
20+
- name: Cache R packages
21+
if: runner.os != 'Windows'
22+
uses: actions/cache@v1
23+
with:
24+
path: /usr/local/lib/R/site-library
25+
key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ hashFiles('.github/depends.Rds') }}
26+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r-
27+
28+
# This lets us augment with additional dependencies
29+
- name: Install system dependencies
30+
if: runner.os == 'Linux'
31+
env:
32+
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
33+
run: |
34+
Rscript -e "remotes::install_github('r-hub/sysreqs')"
35+
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
36+
sudo -s eval "$sysreqs"
37+
38+
- name: Install dependencies
39+
run: |
40+
options(repos = c(CRAN = "https://cran.r-project.org"))
41+
BiocManager::repositories()
42+
remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories())
43+
remotes::install_cran("rcmdcheck")
44+
shell: Rscript {0}
45+
46+
- name: Check
47+
env:
48+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
49+
run: rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check")
50+
shell: Rscript {0}
51+
52+
53+
- name: Build pkgdown
54+
run: |
55+
PATH=$PATH:$HOME/bin/ Rscript -e 'pkgdown::build_site(".")'
56+
57+
# deploy needs rsync? Seems so.
58+
- name: Install deploy dependencies
59+
run: |
60+
apt-get update
61+
apt-get -y install rsync
62+
63+
- name: Deploy 🚀
64+
uses: JamesIves/github-pages-deploy-action@releases/v3
65+
with:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
BRANCH: gh-pages # The branch the action should deploy to.
68+
FOLDER: docs # The folder the action should deploy.
69+
70+
- uses: docker/build-push-action@v1
71+
with:
72+
# The two entries below need to be entered as
73+
# github secrets. The "secret" names are "DOCKER_USERNAME"
74+
# and "DOCKER_PASSWORD". See https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository
75+
# for detailed instructions.
76+
#
77+
# DO NOT EDIT THESE ENTRIES HERE. Doing so will
78+
# expose your docker username and password on github.
79+
username: ${{ secrets.DOCKER_USERNAME }}
80+
password: ${{ secrets.DOCKER_PASSWORD }}
81+
# Use the environment variable on first few lines to set repo name--just centralizes changes
82+
repository: ${{ env.repo-name }}
83+
tag_with_ref: true
84+
tag_with_sha: true
85+
tags: latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
inst/doc
2+
*~

DESCRIPTION

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Package: BuildABiocWorkshop
2+
Title: Bioconductor Workshop Template and Github Actions
3+
Version: 0.9.0
4+
Authors@R:
5+
person(given = "Sean",
6+
family = "Davis",
7+
role = c("aut", "cre"),
8+
email = "[email protected]",
9+
comment = c(ORCID = "your-orc-id-here"))
10+
Description: This package serves as a template for using github actions to
11+
prepare a Bioconductor Workshop package for use. In particular,
12+
a pkgdown website and docker image are generated based on workflow
13+
settings.
14+
License: MIT + file LICENSE
15+
Encoding: UTF-8
16+
LazyData: true
17+
Roxygen: list(markdown = TRUE)
18+
RoxygenNote: 7.1.0
19+
Depends:
20+
Biobase
21+
Suggests:
22+
knitr,
23+
rmarkdown,
24+
pkgdown
25+
URL: https://seandavi.github.io/BuildABiocWorkshop/
26+
BugReports: https://github.com/seandavi/BuildABiocWorkshop/issues/new/choose
27+
VignetteBuilder: knitr
28+
DockerImage: seandavi/buildabiocworkshop:latest

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM bioconductor/bioconductor_docker:devel
2+
3+
WORKDIR /home/rstudio
4+
5+
COPY --chown=rstudio:rstudio . /home/rstudio/
6+
7+
RUN Rscript -e "options(repos = c(CRAN = 'https://cran.r-project.org')); BiocManager::install(ask=FALSE)"
8+
9+
RUN Rscript -e "options(repos = c(CRAN = 'https://cran.r-project.org')); devtools::install('.', dependencies=TRUE, build_vignettes=TRUE, repos = BiocManager::repositories())"

LICENSE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
YEAR: 2020
2+
COPYRIGHT HOLDER: Sean Davis

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MIT License
2+
3+
Copyright (c) 2020 Sean Davis
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Generated by roxygen2: do not edit by hand
2+

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# BuildABiocWorkshop
2+
3+
This package is a template for building a Bioconductor workshop. The package
4+
includes Github actions to:
5+
6+
1. Set up bioconductor/bioconductor_docker:devel on Github resources
7+
2. Install package dependencies for your package (based on the `DESCRIPTION` file)
8+
3. Run `rcmdcheck::rcmdcheck`
9+
4. Build a pkgdown website and push it to github pages
10+
5. Build a docker image with the installed package and dependencies
11+
12+
## Responsibilities
13+
14+
This year, package authors will be primarily responsible for:
15+
16+
1. Creating a landing site of their choosing for their workshops (a website). This website should be listed in the `DESCRIPTION` file as the `URL`.
17+
2. Creating a docker account and image that will contain workshop materials and the installed packages necessary to run those materials. The name of the resulting docker image, including "tag" if desired, should be listed in a non-standard tag, `DockerImage:` in the `DESCRIPTION` file.
18+
19+
Both of those tasks can be accomplished using the Github actions included in this template package. The vignette accompanying this package describes how to accomplish both of these tasks.
20+
21+
## Details
22+
23+
For detailed instructions, see the `How to build a workshop` article/vignette.
24+
25+
## Results of successful deployment
26+
27+
- A working docker image that contains the installed package and dependencies.
28+
- An up-to-date `pkgdown` website at https://YOURUSERNAME.github.io/YOURREPOSITORYNAME/
29+
- Docker image will be tagged with `latest`, `sha-XXXXXX` where `XXXXXX` is the hash of the current `master` commit, and `master`.
30+
31+
## To use the resulting image:
32+
33+
```sh
34+
docker run -e PASSWORD=<choose_a_password_for_rstudio> -p 8787:8787 YOURDOCKERIMAGENAME
35+
```
36+
Once running, navigate to https://localhost:8787/ and then login with `rstudio`:`yourchosenpassword`.
37+
38+
To try with **this** repository docker image:
39+
40+
```sh
41+
docker run -e PASSWORD=abc -p 8787:8787 seandavi/buildabiocworkshop2020
42+
```
43+
44+
*NOTE*: Running docker that uses the password in plain text like above exposes the password to others
45+
in a multi-user system (like a shared workstation or compute node). In practice, consider using an environment
46+
variable instead of plain text to pass along passwords and other secrets in docker command lines.
47+
48+
49+
## Whatcha get
50+
51+
https://seandavi.github.io/BuildABiocWorkshop
52+
53+
![dockerhub](https://github.com/seandavi/BuildABiocWorkshop/raw/master/inst/images/dockerhub_result.png)

_pkgdown.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
url: https://seandavi.github.io/BuildABiocWorkshop
2+
3+
template:
4+
params:
5+
bootswatch: flatly
6+
#ganalytics: UA-99999999-9
7+
8+
home:
9+
title: "BuildABiocWorkshop"
10+
type: inverse
11+
12+
13+
navbar:
14+
right:
15+
- icon: fa-github
16+
href: https://github.com/seandavi/BuildABiocWorkshop
17+
18+

0 commit comments

Comments
 (0)