Skip to content

Commit

Permalink
Create update-tic.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelS1 authored Sep 23, 2022
1 parent f5ba26f commit 132291a
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/update-tic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 4 * * 0" # every week

name: Update tic

jobs:
update-tic:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, r: "release" }

env:
# use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
with:
persist-credentials: false

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
Ncpus: 4

- name: "[Stage] Dependencies"
run: |
Rscript -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/stable')"
Rscript -e "if (grepl('Ubuntu', Sys.info()[['version']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}; pak::pkg_install('ropensci/tic', dependencies = TRUE)"
- name: "[Stage] Update YAMLs"
run: |
Rscript -e "tic::update_yml()"
- name: "[Stage] Create Pull Request"
uses: peter-evans/create-pull-request@v4
with:
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
token: ${{ secrets.TIC_UPDATE }}
title: "Update tic templates [ci-skip]"
commit-message: "update tic templates"
body: "{tic} templates can be updated :rocket: :robot:"
branch: update-tic

0 comments on commit 132291a

Please sign in to comment.