Run compute_daily script #204
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: Run compute_daily script | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: '59 23 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up datetime variables | |
id: date | |
run: | | |
echo "::set-output name=year::$(date -d yesterday +'%Y')" | |
echo "::set-output name=month::$(date -d yesterday +'%m')" | |
echo "::set-output name=day::$(date -d yesterday +'%d')" | |
env: | |
TZ: /usr/share/zoneinfo/Europe/Madrid | |
- name: checkout repo content | |
uses: actions/checkout@v2 # checkout the repository content to github runner | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' # install the python version needed | |
- name: install python packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: execute compute_daily script | |
run: python ${GITHUB_WORKSPACE}/scripts/compute_daily.py --year=${{ steps.date.outputs.year }} --month=${{ steps.date.outputs.month }} --day=${{ steps.date.outputs.day }} | |
- name: Commit structure to git repo | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: Cálculo automático | |
author_name: javi-aranda | |
committer_name: javi-aranda | |
commit: --signoff |