-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (59 loc) · 2.37 KB
/
main.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
59
60
61
62
63
64
65
66
name: Daily Weather updates for each county
on:
schedule:
- cron: "0 */3 * * *" # Runs every day at midnight UTC
jobs:
update-db:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
cd django
python -m pip install --upgrade pip
pip install -r requirements.txt # Install project dependencies
- name: Set environment variables
run: echo "Environment variables set"
env:
DB_NAME: ${{ secrets.DB_NAME }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }}
EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }}
DARAJA_CONSUMER_KEY: ${{ secrets.DARAJA_CONSUMER_KEY }}
DARAJA_CONSUMER_SECRET: ${{ secrets.DARAJA_CONSUMER_SECRET }}
REDIS_URL: ${{ secrets.REDIS_URL }}
WEATHER_API: ${{ secrets.WEATHER_API }}
DARAJA_PASSKEY: ${{ secrets.DARAJA_PASSKEY }}
DEVELOPMENT: ${{ secrets.DEVELOPMENT }}
DEBUG: ${{ secrets.DEBUG }}
DARAJA_SHORTCODE: ${{ secrets.DARAJA_SHORTCODE }}
- name: Run DB update command
run: |
cd django
python manage.py update_weather
env:
DB_NAME: ${{ secrets.DB_NAME }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }}
EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }}
DARAJA_CONSUMER_KEY: ${{ secrets.DARAJA_CONSUMER_KEY }}
DARAJA_CONSUMER_SECRET: ${{ secrets.DARAJA_CONSUMER_SECRET }}
REDIS_URL: ${{ secrets.REDIS_URL }}
WEATHER_API: ${{ secrets.WEATHER_API }}
DARAJA_PASSKEY: ${{ secrets.DARAJA_PASSKEY }}
DEVELOPMENT: ${{ secrets.DEVELOPMENT }}
DEBUG: ${{ secrets.DEBUG }}
DARAJA_SHORTCODE: ${{ secrets.DARAJA_SHORTCODE }}