sha256
1 6f5b37d9b73dcd70f3c8b68eabbe00c4a709f2a3e694d964121af145105f1655
Shikokuchuo
Github Actions with R
Set up a cron job to run your R scripts at specified times.
Enabled with a simple yaml configuration file.
Save the following as main.yml in .github/workflows of your Github repository:
name: Raction
on:
schedule:
- cron: '30 22 * * 1-5'
jobs:
render:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up R
uses: r-lib/actions/setup-r@v1
- name: Install dependencies
run: |
install.packages(c("magrittr", "purrr"), type = "win.binary")
shell: Rscript {0}
- name: Script
run: Rscript nameofscript.R
- name: Commit files
run: |
git config --local user.name github-actions
git config --local user.email "[email protected]"
git add output/*
git commit -am "commit on $(date)"
git push origin main
env:
REPO_KEY: ${{secrets.GITHUB_TOKEN}}
username: github-actions
This example cron job runs every Mon-Fri at 22.30.
Customize your ...