Generate RSS Feeds #94
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: Generate RSS Feeds | |
| on: | |
| schedule: | |
| # Run every day at 4:00 AM | |
| - cron: "0 4 * * *" | |
| workflow_dispatch: # Allow manual trigger | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| scrape-and-generate-feeds: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5.0.0 | |
| - name: Build Docker image | |
| run: | | |
| docker build -t rssible . | |
| - name: Create feeds directory | |
| run: | | |
| mkdir -p feeds | |
| - name: Run Gebäudeforum spider | |
| run: | | |
| docker run --rm -v "${{ github.workspace }}/feeds:/app/feeds" rssible scrapy crawl gebaeudeforum | |
| - name: Run Energieforschung spider | |
| run: | | |
| docker run --rm -v "${{ github.workspace }}/feeds:/app/feeds" rssible scrapy crawl energieforschung | |
| - name: List generated feeds | |
| run: | | |
| ls -la feeds/ | |
| - name: Commit and push feeds | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add feeds/*.xml | |
| git diff --staged --quiet || git commit -m "Update RSS feeds - $(date)" | |
| git push | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload feeds as artifacts | |
| uses: actions/upload-artifact@v4.6.2 | |
| with: | |
| name: rss-feeds | |
| path: feeds/*.xml |