-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (33 loc) · 1.04 KB
/
articles.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Fetch articles
on:
workflow_dispatch:
schedule:
- cron: '0 0,2,6,8,10,12,14,16,18,20,22 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download Feed
run: |-
curl "https://www.publico.pt/api/content/home?&op=false&size=30" | jq -r tostring > hardnews.json
- name: Download Feed
run: |-
curl "https://www.publico.pt/api/page/hp/opinion" | jq -r tostring > opinion.json
- name: Download Feed
run: |-
curl "https://www.publico.pt/api/list/ultimas" | jq -r tostring > latest-news.json
- name: Download Feed
run: |-
curl "https://www.publico.pt/api/content/top-bar" | jq -r tostring > carimbos.json
- name: Commit and push changes
run: |-
git diff
git config user.name "Automated"
git config user.email "---"
git pull
git diff --quiet || (git add -A && git commit -m "Updated with latest articles")
git push