-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.12 KB
/
cron.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
47
48
name: Daily Weather Forecast
on:
schedule:
# Runs every hour
- cron: '0 * * * *'
workflow_dispatch:
jobs:
forecast:
runs-on: ubuntu-latest
environment: API_KEYS
steps:
- name: Echo variables
run: |
echo hours: ${{ vars.GC_TIMEDELTA_HOURS }}
echo lat: ${{ vars.LAT }}
echo lon: ${{ vars.LON }}
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install Pipenv
run: pip install pipenv
- name: Install dependencies using Pipenv
run: |
pipenv install --deploy --ignore-pipfile
- name: Run forecast.py using Pipenv
run: |
cd src
pipenv run python job.py
env:
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
TG_CHAT_ID: ${{ secrets.TG_CHAT_ID }}
OW_API_KEY: ${{ secrets.OW_API_KEY }}
GC_API_KEY: ${{ secrets.GC_API_KEY }}
GC_ID: ${{ secrets.GC_ID }}
GC_TIMEDELTA_HOURS: ${{ vars.GC_TIMEDELTA_HOURS }}
LAT: ${{ vars.LAT }}
LON: ${{ vars.LON }}