Run Python Script Daily #38
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 Python Script Daily | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Triggers the workflow to run at 00:00 UTC every day | |
workflow_dispatch: # Allows manual triggering of the workflow | |
jobs: | |
run-script: | |
runs-on: windows-latest # Specifies that the job should run on a Windows machine | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 # Checks out the repository so that the workflow can access the code | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.13.1' # Sets up Python 3.13.1 environment | |
- name: Install dependencies if not present | |
run: | | |
pip freeze > installed.txt | |
pip install --upgrade -r requirements.txt | |
- name: Run script | |
run: python scripts/main.py # Runs the main.py script |