Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit bff8380

Browse files
committed
R-based data processing
1 parent b6d82a0 commit bff8380

File tree

3 files changed

+460
-0
lines changed

3 files changed

+460
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build Processing Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
paths:
10+
- 'processing/**'
11+
pull_request:
12+
branches:
13+
- main
14+
paths:
15+
- 'processing/**'
16+
17+
env:
18+
REGISTRY: ghcr.io
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
packages: write
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Login to GitHub Container Registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ${{ env.REGISTRY }}
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Extract metadata (tags, labels) for processing container
39+
id: meta-processing
40+
uses: docker/metadata-action@v5
41+
with:
42+
images: ${{ env.REGISTRY }}/${{ github.repository }}/processing
43+
flavor: latest=false
44+
tags: |
45+
type=ref,event=branch
46+
type=ref,event=pr
47+
type=sha,prefix=main-
48+
type=semver,pattern={{version}}
49+
type=semver,pattern={{major}}.{{minor}}
50+
51+
- name: Build and push processing container image
52+
uses: docker/build-push-action@v5
53+
with:
54+
context: ./processing
55+
file: ./processing/dockerfile
56+
push: true
57+
tags: ${{ steps.meta-processing.outputs.tags }}

processing/dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM rocker/r-ver:4.3.3
2+
3+
WORKDIR /home/docker/
4+
5+
# Library initialization using renv
6+
RUN Rscript --vanilla -e " \
7+
options(repos = c(CRAN = 'https://cloud.r-project.org')); \
8+
install.packages('renv') \
9+
"
10+
11+
# Direct dependencies
12+
RUN Rscript --vanilla -e " \
13+
renv::install( \
14+
packages = c( \
15+
'dplyr@1.1.4', \
16+
'magrittr@2.0.3', \
17+
'optparse@1.7.5', \
18+
'readr@2.1.5', \
19+
'renv@1.0.7', \
20+
'stringr@1.5.1', \
21+
'tidyr@1.3.1' \
22+
), \
23+
prompt = F, \
24+
lock = T \
25+
) \
26+
"
27+
# Data processing code
28+
COPY process.R /home/docker/
29+
30+
# Run container
31+
ENTRYPOINT ["Rscript", "--vanilla", "process.R"]

0 commit comments

Comments
 (0)