Generate Screenshots #8
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 Screenshots | |
on: | |
schedule: | |
# Runs at 2 AM GMT+8 (18:00 UTC the previous day) | |
- cron: '0 18 * * *' | |
workflow_dispatch: # Allows manual triggering | |
permissions: | |
contents: write | |
jobs: | |
generate-screenshots: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: pip install requests pillow crawl4ai | |
- name: Generate Screenshots | |
run: python main.py | |
- name: Commit and Push Changes | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add . | |
git diff --quiet && git diff --staged --quiet || (git commit -m "Update screenshots via GitHub action $(TZ='Asia/Singapore' date +'%Y-%m-%d %H:%M:%S')" && git push) |