Skip to content

Commit

Permalink
remove renv from r2u and add new option pak
Browse files Browse the repository at this point in the history
  • Loading branch information
jrosell committed Feb 16, 2024
1 parent ba78885 commit ad89963
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/pak.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: R packages from pak

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: docker build -f pak.Dockerfile -t my-pak-name .
- run: docker run --rm --name my_pak_container -v /github/workspace/output/:/workspace/output/:rw my-pak-name
- uses: actions/upload-artifact@v3
with:
path: /github/workspace/output/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM rocker/r2u:22.04

WORKDIR /workspace

RUN R -e "install.packages(c('dplyr', 'purrr', 'curl', 'readr', 'stringr', 'ggplot2', 'janitor', 'targets', 'renv'))"
RUN R -e "install.packages(c('dplyr', 'purrr', 'curl', 'readr', 'stringr', 'ggplot2', 'janitor', 'targets'))"

COPY _targets.R functions.R /workspace

Expand Down
13 changes: 13 additions & 0 deletions pak.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM rocker/r-ver:4.3

WORKDIR /workspace

RUN R -e "install.packages('pak');pak::pak(c('dplyr', 'purrr', 'curl', 'readr', 'stringr', 'ggplot2', 'janitor', 'targets'))"

COPY _targets.R functions.R /workspace

CMD R -e "sessionInfo(); \
list.files(); \
# options(renv.config.dependencies.limit = Inf); \
renv::snapshot(lockfile = 'output/renv.lock'); \
targets::tar_make();"

0 comments on commit ad89963

Please sign in to comment.