3. Update FrEDI Data (if tests passed) #43
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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 |