-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (66 loc) · 2.06 KB
/
update_fredi_data.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
### Overwrite FrEDI data with past data
# on:
# workflow_run:
# workflows: ["Compile FrEDI Data"]
name: 3. Update FrEDI Data (if tests passed)
on:
workflow_dispatch:
inputs:
passed_tests:
type: choice
description: Did data pass tests?
required: true
options:
- no
- yes
jobs:
# This workflow contains a single job called "build"
update_data:
runs-on: ubuntu-latest
name: Update Data
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Setup R package dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache: true
cache-version: 1
packages: |
any::tidyverse
any::ggpubr
any::openxlsx
any::devtools
any::admisc
- name: Send test status
run: echo "${{ github.event.inputs.passed_tests }}"
- name: Update Data
if: |
github.event.inputs.passed_tests == 'true'
run: |
git rm data/sysdata.rda
cp data/tmp_sysdata.rda data/sysdata.rda
- name: Add SV Data to sysdata
if: |
github.event.inputs.passed_tests == 'true'
run: |
Rscript -e '
pPath0 <- "."
sPath0 <- "./scripts/add_svData_to_sysdata.R"
sPath0 |> source()
add_svData_to_sysdata(projectDir = pPath0, save = T)
'
- name: Commit results
if: |
github.event.inputs.passed_tests == 'true'
run: |
git config --local core.autocrlf false
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
git rm data/tmp_sysdata.rda
git add data/*.rda
git pull origin ${{ github.head_ref }} --autostash --rebase -X ours
git commit -a -m "Updated sysdata and added SV data to sysdata"
git push