Update project overview description file infos #4
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 for Employee Management | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| formatting: | |
| name: π§ Install, Lint & Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Use Node.js 18 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| - name: Install root deps | |
| run: npm ci | |
| - name: Run Prettier | |
| run: npm run format | |
| backend: | |
| name: π Backend JUnit Tests | |
| runs-on: ubuntu-latest | |
| needs: formatting | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Run Maven tests | |
| working-directory: backend | |
| run: mvn --batch-mode test | |
| - name: Archive test reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: junit-reports | |
| path: backend/target/surefire-reports/*.xml | |
| frontend: | |
| name: π Frontend Tests | |
| runs-on: ubuntu-latest | |
| needs: formatting | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Use Node.js 18 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| - name: Install & Test Frontend | |
| working-directory: frontend | |
| run: | | |
| npm ci | |
| npm test | |
| docker: | |
| name: π³ Build & Push Docker Images | |
| runs-on: ubuntu-latest | |
| needs: | |
| - backend | |
| - frontend | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & push backend image | |
| uses: docker/build-push-action@v3 | |
| with: | |
| context: ./backend | |
| file: ./backend/Dockerfile | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/employee-management-backend:${{ github.sha }} | |
| ghcr.io/${{ github.repository_owner }}/employee-management-backend:latest | |
| - name: Build & push frontend image | |
| uses: docker/build-push-action@v3 | |
| with: | |
| context: ./frontend | |
| file: ./frontend/Dockerfile | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/employee-management-frontend:${{ github.sha }} | |
| ghcr.io/${{ github.repository_owner }}/employee-management-frontend:latest | |
| deploy: | |
| name: π Deploying | |
| runs-on: ubuntu-latest | |
| needs: docker | |
| steps: | |
| - name: Announce Deployment | |
| run: | | |
| echo "β Deployed backend to Render" | |
| echo "β Deployed frontend to Vercel" | |
| complete: | |
| name: π All Done | |
| runs-on: ubuntu-latest | |
| needs: deploy | |
| steps: | |
| - name: Final status | |
| run: echo "β CI/CD pipeline finished successfully." |