Skip to content

Generate Python Script on CRON Schedule #143

Generate Python Script on CRON Schedule

Generate Python Script on CRON Schedule #143

name: Generate Python Script on CRON Schedule
on:
# push code to main branch
schedule:
# runs every Sunday
- cron: '00 00 * * 0'
# manually trigger workflow to check
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Check for CSV files and generate if necessary
run: python check_csv.py
- name: execute py script
run: python generate_data.py
- name: Commit and push changes
uses: EndBug/add-and-commit@v9
with:
message: 'Generated CSV files' # commit message
add: 'data/*' # path to CSV files