-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.19 KB
/
weather-forecaster.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
35
36
37
38
39
40
41
42
43
44
45
46
name: Weather Forecast CRON
# Runs every morning at 09:30 CEST time (CET+1)
on:
workflow_dispatch:
schedule:
- cron: "30 07 * * *"
jobs:
forecast_weather:
runs-on: ubuntu-latest
env:
WEATHER_FORECAST_API_URL: ${{ secrets.WEATHER_FORECAST_API_URL }}
USER_AGENT: ${{ secrets.USER_AGENT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Output Current Time
run: |
echo "Current time: $(date +'%Y-%m-%d %H:%M:%S')"
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Call API and save JSON
run: python api.py
- name: Configure Git
run: |
git config --global user.name "Weather Forecast Bot"
git config --global user.email "<>"
- name: Push Generated PNG Image
run: |
git add assets/forecast.png
git commit -m "Overwrote image of today's weather forecast plot"
git push origin main