File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 - " docker-compose.yml"
1010 - " .github/workflows/deploy.yml"
1111
12+ env :
13+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 : true
14+
1215jobs :
1316 deploy :
1417 runs-on : ubuntu-latest
@@ -20,12 +23,14 @@ jobs:
2023 uses : docker/setup-buildx-action@v3
2124
2225 - name : Login to DockerHub
26+ if : ${{ secrets.DOCKER_USERNAME != '' && secrets.DOCKER_PASSWORD != '' }}
2327 uses : docker/login-action@v3
2428 with :
2529 username : ${{ secrets.DOCKER_USERNAME }}
2630 password : ${{ secrets.DOCKER_PASSWORD }}
2731
2832 - name : Build and push backend
33+ if : ${{ secrets.DOCKER_USERNAME != '' && secrets.DOCKER_PASSWORD != '' }}
2934 uses : docker/build-push-action@v5
3035 with :
3136 context : ./backend
3742 cache-to : type=gha,mode=max
3843
3944 - name : Build and push frontend
45+ if : ${{ secrets.DOCKER_USERNAME != '' && secrets.DOCKER_PASSWORD != '' }}
4046 uses : docker/build-push-action@v5
4147 with :
4248 context : ./frontend
4854 cache-to : type=gha,mode=max
4955
5056 - name : Deploy to server
57+ if : ${{ secrets.DEPLOY_HOST != '' && secrets.DEPLOY_USER != '' && secrets.DEPLOY_KEY != '' }}
5158 uses : appleboy/ssh-action@v1.0.0
5259 with :
5360 host : ${{ secrets.DEPLOY_HOST }}
Original file line number Diff line number Diff line change 1616 - aggregate
1717 - cleanup
1818
19+ env :
20+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 : true
21+
1922jobs :
2023 etl :
2124 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 1111 paths :
1212 - " backend/**"
1313
14+ env :
15+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 : true
16+
1417jobs :
1518 test :
1619 runs-on : ubuntu-latest
5659 pip install -r requirements.txt
5760 pip install pytest pytest-cov
5861
62+ - name : Initialize database tables
63+ working-directory : ./backend
64+ env :
65+ DATABASE_URL : postgresql://postgres:postgres@localhost:5432/bi_platform
66+ REDIS_HOST : localhost
67+ REDIS_PORT : 6379
68+ run : |
69+ python -c "from app.database import init_db; init_db(); print('Database tables created successfully')"
70+
5971 - name : Run tests
6072 working-directory : ./backend
6173 env :
6678 pytest tests/ -v --cov=app --cov-report=xml --cov-report=term
6779
6880 - name : Upload coverage
81+ if : always()
6982 uses : codecov/codecov-action@v3
7083 with :
7184 file : ./backend/coverage.xml
Original file line number Diff line number Diff line change 1+ import sys
2+ import os
3+
4+ sys .path .insert (0 , os .path .join (os .path .dirname (__file__ ), ".." ))
5+
6+ from app .database import init_db
7+
8+ init_db ()
You can’t perform that action at this time.
0 commit comments