Removed duplicate files, fixed app build #13
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| cache-dependency-path: app/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./app | |
| run: npm ci | |
| - name: Build backend | |
| working-directory: ./app | |
| run: npm run build --workspace=backend | |
| - name: Build frontend | |
| working-directory: ./app | |
| run: npm run build --workspace=frontend | |
| - name: Verify build artifacts | |
| working-directory: ./app | |
| run: | | |
| echo "Checking backend build artifacts..." | |
| test -d backend/dist || (echo "Backend dist directory not found" && exit 1) | |
| test -f backend/dist/server.js || (echo "Backend server.js not found" && exit 1) | |
| test -f backend/dist/discount-rules.js || (echo "Backend discount-rules.js not found" && exit 1) | |
| echo "Checking frontend build artifacts..." | |
| test -d frontend/dist || (echo "Frontend dist directory not found" && exit 1) | |
| test -f frontend/dist/index.html || (echo "Frontend index.html not found" && exit 1) | |
| echo "✅ All build artifacts verified successfully" | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: | | |
| app/backend/dist/ | |
| app/frontend/dist/ | |
| retention-days: 7 |