Skip to content

Scrape daily data #1388

Scrape daily data

Scrape daily data #1388

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Scrape daily data
# Controls when the action will run.
on:
schedule:
- cron: '1 0 * * *'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v2
- name: Fetch latest data
run: |-
curl "https://apidatos.ree.es/datos/mercados/precios-mercados-tiempo-real?start_date=`date --iso-8601`T00:00&end_date=`date --iso-8601`T23:59&time_trunc=hour" | tee data.json
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push