Update CSV File #88
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |