Skip to content

Commit

Permalink
feat: add a step to update repo channel pre restore
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Aug 17, 2023
1 parent b9899c1 commit 2bd414c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,21 @@ jobs:
key: ${{ env.CACHE_KEY }}-${{ hashFiles(format('{0}/{1}/renv.lock', github.event.repository.name, matrix.directory)) }}
restore-keys: ${{ env.CACHE_KEY }}-

- name: Update renv lock file with repo channel
shell: Rscript{0}
working-directory: ${{ github.event.repository.name }}
run: |
setwd("${{ matrix.directory }}")
repos <- renv::lockfile_read()$R$Repositories
repos$Pharmaverse <- "${{ matrix.repository }}"
renv::lockfile_modify(repos = repos) |> renv::lockfile_write()
- name: Install R packages using renv and update the renv snapshot
shell: Rscript {0}
working-directory: ${{ github.event.repository.name }}/${{ matrix.directory }}
run: |
options(renv.config.cache.symlinks = FALSE)
lockfile_packages <- renv::lockfile_read()$Packages |> names()
repos <- renv::lockfile_read()$R$Repositories
repos$Pharmaverse <- "${{ matrix.repository }}"
renv::lockfile_modify(repos = repos) |> renv::lockfile_write()
renv::update(lockfile_packages)
renv::snapshot(packages = lockfile_packages, update = TRUE)
- name: Print the new renv.lock file for ${{ matrix.directory }}
Expand Down

0 comments on commit 2bd414c

Please sign in to comment.