Skip to content

Commit

Permalink
Example code to generate RSS feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinnl committed Jul 2, 2021
0 parents commit 154228c
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish RSS feeds to GitHub Pages

on:
push:
branches:
- main
schedule:
# * is a special character in YAML so you have to quote this string
# Run every day at 5:30 and 17:30:
- cron: '30 5,17 * * *'

env:
CI: true
jobs:
publish-feeds:
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- uses: microsoft/playwright-github-action@v1
- run: 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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public
11 changes: 11 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pages:
stage: deploy
image: mcr.microsoft.com/playwright:focal
script:
- npx feed-me-up-scotty
artifacts:
paths:
- public
expire_in: 1 day
only:
- main
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CI setup for Feed me up, Scotty!

You can fork this repository and edit `feeds.toml` to start generating your own
RSS feeds.
13 changes: 13 additions & 0 deletions feeds.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[funfacts]
title = "Wikipedia — did you know?"
url = "https://en.wikipedia.org/wiki/Main_Page"
entrySelector = "#mp-dyk > ul li"
titleSelector = "b"
linkSelector = "b a"

[wikivoyage]
title = "Wikivoyage recommendations"
url = "https://en.wikivoyage.org/wiki/Main_Page"
entrySelector = ".jcarousel-wrapper .jcarousel-item"
titleSelector = "h2"
linkSelector = "h2 a"

0 comments on commit 154228c

Please sign in to comment.