Skip to content

Commit f33768b

Browse files
committed
Add github actions to update the rss feed
1 parent 4654a40 commit f33768b

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/update.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Update RSS
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # every 24 hours
6+
workflow_dispatch: # allow manual run
7+
8+
jobs:
9+
update:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Run scraper
25+
run: node index.js
26+
27+
- name: Commit RSS update
28+
run: |
29+
git config user.name "github-actions"
30+
git config user.email "github-actions@github.com"
31+
git add rss.xml
32+
git diff --cached --quiet || git commit -m "Update RSS feed"
33+
git push

0 commit comments

Comments
 (0)