-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (39 loc) · 1.19 KB
/
run_job.yaml
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
name: Run data collection
on:
push:
paths:
- '.tracked_repos'
- '**.R'
- '.github/workflows/run_job.yaml'
schedule:
# beware the ides
- cron: '0 0 15 * *'
jobs:
data-collection:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: r-lib/actions/setup-r@v2
- name: Set GIT
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
- name: System & package dependencies
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
Rscript -e "install.packages('xml2')"
- name: Run Rscript
run: Rscript update_archives.R
- name: Get Date
id: date
run: echo "::set-output name=date::$(TZ=UTC date +%Y-%m-%d_%H-%M-%S)"
- name: Commit new data
run: |
git add --all
git commit -m "New data collected at ${{ steps.date.outputs.date }}" || echo "No updates to archive since last run"
- name: Push data
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: 'master'