-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (46 loc) · 1.79 KB
/
update-abs.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
49
50
51
52
53
54
55
# Check every day at 11:10am Adelaide/Australia for updated ABS data
name: update-abs
# Controls when the action will run. Run this job every weekday at 12:40am UTC, which should be 11:10am Adelaide time
on:
schedule:
- cron: '35 0 * * 1-5'
push:
branches:
- master
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
update-data:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libharfbuzz-dev libfribidi-dev
sudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev
- uses: r-lib/actions/setup-renv@v2
- name: Get data
run: |
Rscript data-raw/update_data.R
- name: Document data
run: |
Rscript -e "install.packages('devtools')"
Rscript -e "devtools::document()"
- name: Render README
run: |
Rscript -e "devtools::install_github('aiti-flinders/aitidata')"
Rscript -e "rmarkdown::render(here::here('README.Rmd'))"
- name: Commit
run: |
git config --global user.name 'Hamish Gamble'
git config --global user.email 'gamb0043@flinders.edu.au'
git add .
git commit -m 'Scheduled data updates' || echo "No changes to commit"
git push || echo "No changes to commit"