Download_SOS_Medecins_data #1285
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
# This is a basic workflow to help you get started with Actions | |
name: Download_SOS_Medecins_data | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
push: | |
branches: [ master ] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f download_data/requirements.txt ]; then pip install -r download_data/requirements.txt; fi | |
- name: Download data | |
run: | | |
python download_data/download_data.py | |
- name: git check in | |
env: | |
GIT_OWNER_EMAIL: ${{ secrets.EMAIL }} | |
PUSH_TOKEN: ${{ secrets.PUSH_TOKEN }} | |
run: | | |
git config user.email "$GIT_OWNER_EMAIL" | |
git config user.name "louisdecharson" | |
git diff --quiet && ( | |
echo 'No changes detected' | |
) || ( | |
git add sursaud_corona.csv sursaud_corona_raw.csv | |
git commit -am "AUTO - Add data.gouv.fr COVID data from SOS Medecins - $(date "+%Y-%m-%d %Hh%Mm")" | |
git remote rm origin | |
git remote add origin https://louisdecharson:${PUSH_TOKEN}@github.com/louisdecharson/covid-19.git | |
git push origin HEAD:master | |
) | |
# - uses: actions/upload-artifact@v2 | |
# with: | |
# name: upload-file | |
# path: sursaud_corona.csv |