diff --git a/.github/workflows/pak.yml b/.github/workflows/pak.yml new file mode 100644 index 0000000..956e58a --- /dev/null +++ b/.github/workflows/pak.yml @@ -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/ diff --git a/Dockerfile b/Dockerfile index 5e63f21..12d5726 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/pak.Dockerfile b/pak.Dockerfile new file mode 100644 index 0000000..bab2d63 --- /dev/null +++ b/pak.Dockerfile @@ -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();" \ No newline at end of file