-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (49 loc) · 1.47 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
49
50
51
52
53
54
55
56
57
58
name: Daily Weather Forecast
on:
schedule:
# Runs every hour
- cron: '0 */3 * * *'
workflow_dispatch:
inputs:
timedelta_hours:
type: string
description: Look into future for this many hours
required: false
jobs:
forecast:
runs-on: ubuntu-latest
environment: API_KEYS
steps:
- name: Echo variables
run: |
echo hours override: [${{ inputs.timedelta_hours }}]
echo config hours: [${{ vars.GC_TIMEDELTA_HOURS }}]
echo config lat: [${{ vars.LAT }}]
echo config 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: |
if [ "${{ inputs.timedelta_hours }}" ]; then
export GC_TIMEDELTA_HOURS=${{ inputs.timedelta_hours }}
fi
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 }}