-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.25 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
on:
schedule:
- cron: '00 12 */3 * *'
jobs:
update-report:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Check out repository
uses: actions/checkout@v3
- uses: actions/cache@v3 # Cache packages so won't be compiled everytime job is run
with:
path: ~/.local/share/renv
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Install packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::tidyverse
any::rio
any::rvest
any::httr2
any::jsonlite
- name: Web Crawling
run: source("gov_website.R")
shell: Rscript {0}
- name: Commit files
run: |
git config --local user.name actions-user
git config --local user.email "[email protected]"
git add data/*
git commit -am "GH ACTION Headlines $(date)"
git push origin main
env:
REPO_KEY: ${{secrets.GITHUB_TOKEN}}
username: github-actions