.github/workflows/italy.yml #1964
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: Fetch latest Italian data | |
on: | |
repository_dispatch: | |
schedule: | |
- cron: '0 2 * * *' | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out this repo | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- uses: actions/cache@v1 | |
name: Configure pip caching | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Python dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Fetch latest Italian data | |
run: |- | |
mkdir -p italy | |
cd italy | |
wget -q -O italy.csv "https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-regioni/dpc-covid19-ita-regioni.csv" | |
- name: Commit and push Italian data if it changed | |
run: |- | |
git config user.name "Automated" | |
git config user.email "actions@users.noreply.github.com" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest Italian data: ${timestamp}" || exit 0 | |
git push |