Skip to content

Publish RSS feeds to GitHub Pages #3611

Publish RSS feeds to GitHub Pages

Publish RSS feeds to GitHub Pages #3611

Workflow file for this run

name: Publish RSS feeds to GitHub Pages
on:
push:
branches: ["main"]
paths:
- "**"
- "!README.md"
schedule:
# * is a special character in YAML so you have to quote this string
# Run every hour:
- cron: "0 * * * *"
workflow_dispatch:
env:
CI: true
jobs:
publish-feeds:
runs-on: ubuntu-20.04
timeout-minutes: 30
env:
TWITTER_ACCOUNT_PASSWORD: ${{ secrets.TWITTER_ACCOUNT_PASSWORD }}
TWITTER_COOKIE_VALUE: ${{ secrets.TWITTER_COOKIE_VALUE }}
steps:
- uses: actions/checkout@v4
- run: npx playwright install firefox --with-deps
- uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: npx feed-me-up-scotty
- uses: actions/setup-python@v5
with:
python-version: "3.10"
# trunk-ignore(yamllint/quoted-strings)
cache: "pip"
- run: pip install -r requirements.txt
- run: playwright install firefox --with-deps
# Check the generated XML files from feed-me-up-scotty (at least 1 entry)
- name: Check generated XML feeds
run: python check_feeds.py
- name: Restore tw_session cache
id: cache-tw-session
uses: actions/cache@v3
with:
path: ./SESSION.tw_session
key: SESSION.tw_session
- name: Run twitter.py
run: |
python twitter.py
- name: Save updated tw_session cache
if: always()
uses: actions/cache@v3
with:
path: ./SESSION.tw_session
key: SESSION.tw_session
restore-keys: |
tw-session-
- name: Deploy to GitHub Pages
run: |
git config user.name $GITHUB_ACTOR
git config user.email [email protected]
git remote add gh-pages-remote https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git
git fetch --no-recurse-submodules
git worktree add ./gh-pages gh-pages
cd gh-pages
git rm -r .
cp -r ../public/. .
git add .
git commit --message="Deploying to GitHub Pages from $GITHUB_SHA"
git push gh-pages-remote gh-pages:gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}