Update Preview Image #95
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: Update Preview Image | |
on: | |
schedule: | |
- cron: '0 2 * * 0' # Runs every Sunday at 2 AM UTC | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: run script | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r code/requirements.txt | |
python code/script.py | |
- name: Commit and push if it changed | |
run: | | |
git config user.name "Update-Img Bot" | |
git config user.email "[email protected]" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Automated update: ${timestamp}" || exit 0 | |
git push |