Skip to content

Fetch articles

Fetch articles #7183

Workflow file for this run

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