-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.2 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 08:30 (UTC+1 time)
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 maybe save JSON
run: python forecast_weather.py
- name: Configure Git
run: |
git config --global user.name "Weather Forecast Bot"
git config --global user.email "<>"
- name: Commit and push changes to main branch
run: |
git add .
git commit -m "Today's weather forecast"
git push origin main