Merge pull request #11 from alexops-dev/dependabot/npm_and_yarn/front… #43
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 | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| postgres: | ||
| image: postgres:13-alpine | ||
| env: | ||
| POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | ||
| POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | ||
| POSTGRES_DB: ${{ secrets.POSTGRES_DB }} | ||
| ports: | ||
| - 5432:5432 | ||
| options: >- | ||
| --health-cmd "pg_isready -U ${{ secrets.POSTGRES_USER }}" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.8' | ||
| - name: Install dependencies (backend) | ||
| run: | | ||
| cd backend | ||
| pip install -r requirements.txt | ||
| env: | ||
| POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | ||
| POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | ||
| POSTGRES_DB: ${{ secrets.POSTGRES_DB }} | ||
| - name: Run tests (backend) | ||
| run: | | ||
| cd backend | ||
| pytest | ||
| env: | ||
| POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | ||
| POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | ||
| POSTGRES_DB: ${{ secrets.POSTGRES_DB }} | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| - name: Install dependencies (frontend) | ||
| run: | | ||
| cd frontend | ||
| npm install | ||
| - name: Build Angular app | ||
| run: | | ||
| cd frontend | ||
| npm run build | ||