Update {renv} components #429
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
# This is a basic workflow to help you get started with Actions | |
name: Update {renv} components | |
# Controls when the workflow will run | |
on: | |
push: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
contents: write | |
pages: write | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
RENV_PATHS_ROOT: ~/.local/share/renv/ | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
install-r: false | |
use-public-rspm: true | |
- name: Cache packages | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.RENV_PATHS_ROOT }} | |
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | |
restore-keys: | | |
${{ runner.os }}-renv- | |
- name: Install curl | |
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev | |
- name: Install textshaping dependencies | |
run: sudo apt-get install -y libharfbuzz-dev libfribidi-dev libtiff5-dev | |
# Runs a single command using the runners shell | |
- name: Update renv | |
shell: Rscript {0} | |
run: | | |
if (!requireNamespace("renv", quietly = TRUE)) { | |
install.packages("renv") | |
} | |
source("renv_update.R") | |
- name: Push back to main | |
run: | | |
git config --local user.name "GitHub Actions" | |
git config --local user.email "[email protected]" | |
git add . | |
git commit -m '[actions] update renv.lock :rocket:' || echo "No changes to commit" | |
git push origin || echo "No changes to commit" | |