Generate Python Script on CRON Schedule #114
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: 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 |