Skip to content

data_daily_updating #225

data_daily_updating

data_daily_updating #225

name: data_daily_updating
# Controls when the workflow will run
on:
# # Triggers the workflow on push or pull request events but only for the "main" branch
# push:
# branches: ["main"]
# pull_request:
# branches: ["main"]
schedule:
# run 4h30min every day
- cron: "30 7 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
data_daily_updating:
runs-on: ubuntu-latest
# continue-on-error: true
steps:
#### actions/checkout ____________________________________________________
# @see https://github.com/actions/checkout
- uses: actions/checkout@v3
#### setup-python ________________________________________________________
# @see https://github.com/actions/setup-python
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip' # caching pip dependencies
#### setup dependencies __________________________________________________
- run: pip install -r requirements.txt
#### main ________________________________________________________________
- run: |
git submodule init
git submodule update
cd oswm_codebase
git pull -r https://github.com/kauevestena/oswm_codebase
cd ..
- run: python oswm_codebase/getting_data.py
- run: python oswm_codebase/filtering_adapting_data.py
- run: python oswm_codebase/create_webmap.py
- run: python oswm_codebase/data_quality/tag_values_checking.py
- run: python oswm_codebase/data_quality/quality_check_compiling.py
- run: python oswm_codebase/statistics_generation.py
#### upload ______________________________________________________________
# @see https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
- run: |
DATETIME="$(TZ=":America/Sao_Paulo" date +"%Y-%m-%d")"
COMMIT_MESSAGE="data updating at $DATETIME"
git config user.name github-actions
git config user.email github-actions@github.com
git pull
git add .
git commit -m "$COMMIT_MESSAGE"
git push