Sondaggi politici italiani #64
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: Sondaggi politici italiani | |
on: | |
schedule: | |
- cron: '30 12 * * *' | |
# push: | |
# branches: | |
# - main | |
workflow_dispatch: | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Utilizza l'action github checkout@v3, per automatizzare il check-out | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install -r italian_polls/script/requirements.txt | |
- name: crea cartella utente bin, copia dentro l'eseguibile scrape e mlr | |
run: |- | |
mkdir -p ~/bin | |
cp bin/mlrgo ~/bin/mlr | |
cp bin/duckdb ~/bin | |
cd ~/bin | |
chmod +x mlr | |
chmod +x duckdb | |
- name: esegui lo script base | |
run: |- | |
export PATH=$PATH:~/bin | |
cd ./italian_polls/script | |
chmod +x ./italian_polls.sh | |
./italian_polls.sh | |
- name: Committa e pusha se ci sono variazioni nei dati | |
run: |- | |
git config user.name "automatico" | |
git config user.email "[email protected]" | |
git add -A | |
timestamp=$(date --iso-8601=seconds) | |
git commit -m "aggiornamento dati sondaggi: ${timestamp}" || exit 0 | |
git push | |