From 2bd414cacfe04ed7a52ee8f98d1c8db370f2faac Mon Sep 17 00:00:00 2001 From: vedhav Date: Thu, 17 Aug 2023 12:15:41 +0530 Subject: [PATCH] feat: add a step to update repo channel pre restore --- .github/workflows/deploy.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 348e41c8..511644ea 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -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 }}