-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.31 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
46
47
48
49
name: Hourly R Script Execution
on:
push:
branches:
- main
schedule:
- cron: '0 12-21/1 * * 1-5' # Schedule to run every 1 hour from 12pm to 9pm UTC, Monday to Friday
jobs:
import-data:
runs-on: ubuntu-latest
steps:
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Cache R packages
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: r-${{ hashFiles('**/renv.lock') }}
- name: Install packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::glue
any::purrr
any::tibble
any::ralger
any::readr
any::ralger
- name: Checkout code
uses: actions/checkout@v3
- name: Execute R script
run: Rscript -e 'source("premarket.R")'
- name: Commit results
env:
GITHUB_PAT: ${{ secrets.GBG }} # Required for pushing changes to the repository
run: |
git config user.email "${{ github.actor }}@users.noreply.github.com"
git config user.name "${{ github.actor }}"
git add market-watch.csv
git commit -m 'Data updated' || echo "No changes to commit"
git push origin || echo "No changes to commit"