-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (41 loc) · 1.42 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# This is a basic workflow that only runs on schedule
name: run_job_2
on:
schedule:
- cron: '0 9 * * *'
# 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
run_thingy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# retrieve secrets from github
env:
apikey: ${{ secrets.APIKEY}}
apisecretkey: ${{ secrets.APISECRETKEY}}
access_token: ${{ secrets.ACCESS_TOKEN}}
access_token_secret: ${{ secrets.ACCESS_TOKEN_SECRET}}
RENV_PATHS_ROOT: ~/.local/share/renv
#
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: setup-r
uses: r-lib/actions/setup-r@v1
with:
r-version: '4.0.2'
# install renv package
- run: R -e 'install.packages("renv")'
# set up cache
- name: Cache packages
uses: actions/cache@v1
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |-
${{ runner.os }}-renv-
- run: sudo apt-get install -y --no-install-recommends libcurl4-openssl-dev
# install c++ dependencies and install necessary packages
- run: R -e 'renv::restore()'
# execute Rscript
- run: Rscript run_job.R