Update target data #10
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
name: Update target data | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: [Update RSV data] | |
types: | |
- completed | |
jobs: | |
update-target-data: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Install system dependencies | |
run: sudo apt-get install libcurl4-openssl-dev libudunits2-dev libgdal-dev | |
- name: Install dependencies | |
run: | | |
R -e 'install.packages(c("lubridate", "dplyr", "tidyr", "arrow"))' | |
- name: Update target data | |
run: Rscript target-data/get_target_data.R | |
- name: Commit | |
run: | | |
git config user.name Github-Actions | |
git config user.email "<>" | |
if [ -n "$(git status --porcelain)" ]; then | |
git add . | |
git commit -m "Update target data $(date)" | |
git push | |
echo "Target data updated"; | |
else | |
echo "no updates"; | |
fi |