Update README.md #9
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/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test-backend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| cd src/backend | |
| pip install -r requirements.txt | |
| - name: Run tests | |
| run: | | |
| cd src/backend | |
| python -m pytest | |
| test-frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| cache-dependency-path: scripts/package-lock.json | |
| - name: Install dependencies | |
| run: | | |
| cd src/frontend | |
| npm install | |
| - name: Run tests | |
| run: | | |
| cd src/frontend | |
| npm run test | |
| - name: Build | |
| run: | | |
| cd src/frontend | |
| npm run build | |
| deploy: | |
| needs: [test-backend, test-frontend] | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Deploy to production | |
| run: | | |
| echo "Deploy to production server" |