diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000000..a12473e3217 --- /dev/null +++ b/.github/workflows/pages.yml @@ -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/checkout@v2.3.4 + - 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 $GITHUB_ACTOR@users.noreply.github.com + git remote add gh-pages-remote https://x-access-token:$GITHUB_TOKEN@github.com/$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 }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..a48cf0de7af --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +public diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000000..a740622c945 --- /dev/null +++ b/.gitlab-ci.yml @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 00000000000..519d7f0a24f --- /dev/null +++ b/README.md @@ -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. diff --git a/feeds.toml b/feeds.toml new file mode 100644 index 00000000000..1462490b41d --- /dev/null +++ b/feeds.toml @@ -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"