Run Selenium Feeds #185
This file contains hidden or 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 Selenium Feeds | |
| on: | |
| schedule: | |
| - cron: "30 * * * *" | |
| workflow_dispatch: | |
| concurrency: | |
| group: selenium-feeds | |
| cancel-in-progress: true | |
| jobs: | |
| run-selenium-feeds: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/[email protected] | |
| with: | |
| enable-cache: true | |
| - name: Install Chrome for Selenium | |
| uses: browser-actions/setup-chrome@v2 | |
| with: | |
| chrome-version: stable | |
| install-chromedriver: true | |
| - name: Install dependencies and run Selenium feeds | |
| timeout-minutes: 45 | |
| run: | | |
| set -e | |
| uv sync | |
| uv run feed_generators/run_all_feeds.py --selenium-only | |
| - name: Commit and push feeds | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add feeds/*.xml | |
| git stash | |
| git pull --rebase || { echo "Rebase failed, aborting and retrying with merge"; git rebase --abort 2>/dev/null; git pull; } | |
| git stash pop || true | |
| git add feeds/*.xml | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m 'Update RSS feeds (Selenium)' | |
| git push || { git pull --rebase && git push; } | |
| fi |