Fetch weather #11315
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fetch weather | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0,3,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,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://api.open-meteo.com/v1/forecast?latitude=38.74&longitude=-9.28&daily=weathercode,temperature_2m_max,temperature_2m_min¤t_weather=true&forecast_days=1&timezone=Europe%2FLondon" | jq -r tostring > weather.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 weather") | |
git push |