Run Python script every 24 hours #165
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 every 24 hours | |
on: | |
schedule: | |
- cron: '0 0 * * *' # runs every day at midnight | |
jobs: | |
run_script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: setup node version | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' # Use the Python version you need | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt # If you have any requirements | |
- name: Run Python script | |
env: | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
run: | | |
python sphinx_webscrape.py | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "updated last run time" | |
git push |