Update RSS Feed #1
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: Update RSS Feed | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 1' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-rss: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.4' | |
| bundler-cache: true | |
| - name: Generate RSS entry | |
| run: | | |
| bundle exec ruby lib/generate_rss.rb | |
| - name: Build site | |
| run: | | |
| bundle exec middleman build | |
| - name: Commit and push changes | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| WEEK_DATE=$(date -u +%Y-%m-%d) | |
| git add source/data/rss_entries.yml | |
| if ! git diff --staged --quiet; then | |
| git commit -m "Update RSS feed for week beginning $WEEK_DATE" | |
| git push | |
| else | |
| echo "No changes to commit" | |
| fi | |