Publish RSS feeds to GitHub Pages #24577
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: Publish RSS feeds to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '00 * * * *' | |
workflow_dispatch: | |
env: | |
CI: true | |
jobs: | |
publish-feeds: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/[email protected] | |
- uses: microsoft/playwright-github-action@v1 | |
- run: npx playwright install firefox | |
# GitHub Actions unfortunately does not support retries; | |
# this is a cumbersome method of retrying twice in case of errors: | |
- run: npx feed-me-up-scotty || npx feed-me-up-scotty || npx feed-me-up-scotty | |
- 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 }} |