Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ pipeline_stores
^[^/]*\.r$
^tests$
_targets
target_framework
target_framework
^Dockerfile$
^\\.dockerignore$
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git
.github
.Rproj.user
renv
renv.lock
pipeline_store
_targets
56 changes: 56 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: docker-image

on:
push:
branches:
- main
- master
tags:
- 'v*'
pull_request:
branches:
- main
- master
workflow_dispatch:

jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/hpcell
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=sha

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ghcr.io/bioconductor/bioconductor_docker:RELEASE_3_21

COPY . /opt/HPCell
RUN R -q -e "desc <- read.dcf('/opt/HPCell/DESCRIPTION'); pkgs <- unique(trimws(unlist(strsplit(paste(desc[1, c('Depends', 'Imports')], collapse = ','), ',')))); pkgs <- sub('\\\\s*\\\\(.*\\\\)', '', pkgs); pkgs <- pkgs[pkgs != '' & pkgs != 'R']; repos <- c(CRAN = 'https://cloud.r-project.org', BioCsoft = 'https://bioconductor.org/packages/3.21/bioc', BioCann = 'https://bioconductor.org/packages/3.21/data/annotation', BioCexp = 'https://bioconductor.org/packages/3.21/data/experiment', BioCworkflows = 'https://bioconductor.org/packages/3.21/workflows'); install.packages(pkgs, repos = repos)"
RUN R CMD INSTALL /opt/HPCell

WORKDIR /work
CMD ["R"]
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ The key features of HPCell include:
remotes::install_github("MangiolaLaboratory/HPCell")
```

### Docker image

GitHub Actions now publishes a pre-built container image to GHCR:

``` bash
docker pull ghcr.io/mangiolalaboratory/hpcell:main
docker run --rm -it ghcr.io/mangiolalaboratory/hpcell:main
```

## The input

The pipeline accepts a vector of file paths. If this vector is named,
Expand Down
10 changes: 9 additions & 1 deletion README.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ remotes::install_github("MangiolaLaboratory/HPCell")

```

### Docker image

GitHub Actions now publishes a pre-built container image to GHCR:

```{bash, eval=FALSE}
docker pull ghcr.io/mangiolalaboratory/hpcell:main
docker run --rm -it ghcr.io/mangiolalaboratory/hpcell:main
```

## The input

The pipeline accepts a vector of file paths.
Expand Down Expand Up @@ -724,4 +733,3 @@ By summarizing single-cell data into groups, it mimics traditional bulk RNA-seq
... |>
tidySingleCellExperiment::aggregate_cells(!!x, slot = "data", assays=assays)
```

Loading