-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b6d82a0
commit bff8380
Showing
3 changed files
with
460 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Build Processing Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
paths: | ||
- 'processing/**' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'processing/**' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for processing container | ||
id: meta-processing | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ github.repository }}/processing | ||
flavor: latest=false | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=sha,prefix=main- | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Build and push processing container image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./processing | ||
file: ./processing/dockerfile | ||
push: true | ||
tags: ${{ steps.meta-processing.outputs.tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM rocker/r-ver:4.3.3 | ||
|
||
WORKDIR /home/docker/ | ||
|
||
# Library initialization using renv | ||
RUN Rscript --vanilla -e " \ | ||
options(repos = c(CRAN = 'https://cloud.r-project.org')); \ | ||
install.packages('renv') \ | ||
" | ||
|
||
# Direct dependencies | ||
RUN Rscript --vanilla -e " \ | ||
renv::install( \ | ||
packages = c( \ | ||
'dplyr@1.1.4', \ | ||
'magrittr@2.0.3', \ | ||
'optparse@1.7.5', \ | ||
'readr@2.1.5', \ | ||
'renv@1.0.7', \ | ||
'stringr@1.5.1', \ | ||
'tidyr@1.3.1' \ | ||
), \ | ||
prompt = F, \ | ||
lock = T \ | ||
) \ | ||
" | ||
# Data processing code | ||
COPY process.R /home/docker/ | ||
|
||
# Run container | ||
ENTRYPOINT ["Rscript", "--vanilla", "process.R"] |
Oops, something went wrong.