coronaPL gov PL data refresh #1271
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: coronaPL gov PL data refresh | |
on: | |
push: | |
branches: [main, master] | |
schedule: | |
- cron: '00 10,12 * * *' | |
jobs: | |
data_refresh_master: | |
name: dataset refresh | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: checkout_repo | |
uses: actions/checkout@v2 | |
with: | |
ref: 'main' | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Refresh the data | |
run: python ./gov/govData.py | |
- name: Commit changes | |
run: | | |
git config --local user.email "$(git log --format='%ae' HEAD^!)" | |
git config --local user.name "$(git log --format='%an' HEAD^!)" | |
git remote add github "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git" | |
git pull github ${GITHUB_REF} --ff-only | |
git add . | |
if [ -z "$(git status --porcelain)" ]; then | |
exit 0 | |
fi | |
git commit -m "Update COVID GOV data" | |
git push github HEAD:${GITHUB_REF} |