-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.07 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
67
68
69
70
71
72
73
74
75
76
name: Update CSV File
on:
schedule:
- cron: '0 0 * * 0'
# You can also run this workflow manually from the Actions tab
workflow_dispatch:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
env:
TZ: Asia/Singapore
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install -e .
- name: Update resale dataset
run: python ./src/update_csv.py
- name: Commit and push changes for database
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "actions: update HDB database file" && echo "CHANGES_DETECTED=1" >> $GITHUB_ENV || echo "no changes to commit"
git push
- name: Update mrts
run: python ./src/update_mrts.py
continue-on-error: true
- name: Commit and push changes for mrt
run: |
git add -A
git commit -m "actions: update MRT database file" || echo "no changes to commit"
git push
continue-on-error: true
- name: Update rental dataset
run: python ./src/update_rental.py
- name: Commit and push changes for mrt
run: |
git add -A
git commit -m "actions: update rental dataset" || echo "no changes to commit"
git push
- name: Train model
env:
CHANGES_DETECTED: ${{ env.CHANGES_DETECTED }}
if: env.CHANGES_DETECTED == '1'
run: python ./src/train.py
- name: Commit and push changes for model
env:
CHANGES_DETECTED: ${{ env.CHANGES_DETECTED }}
if: env.CHANGES_DETECTED == '1'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "actions: update model" || echo "no changes to commit"
git push