chore: remove Cypress E2E tests and pipeline step. Not required by as… #32
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: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: '18' | |
| - name: Install Dependencies | |
| run: | | |
| npm install | |
| cd frontend && npm install | |
| cd ../backend && npm install | |
| - name: Run Frontend Tests | |
| run: | | |
| cd frontend | |
| npm run test | |
| npm run test:coverage | |
| - name: Run Backend Tests | |
| run: | | |
| cd backend | |
| npm run test | |
| deploy: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Deploy Frontend to Vercel | |
| uses: amondnet/vercel-action@v20 | |
| with: | |
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
| vercel-project-id: ${{ secrets.VERCEL_FRONTEND_PROJECT_ID }} | |
| working-directory: ./frontend | |
| vercel-args: '--prod' | |
| - name: Deploy Backend to Vercel | |
| uses: amondnet/vercel-action@v20 | |
| with: | |
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
| vercel-project-id: ${{ secrets.VERCEL_BACKEND_PROJECT_ID }} | |
| working-directory: ./backend | |
| vercel-args: '--prod' | |
| - name: Update Frontend Environment | |
| if: success() | |
| run: | | |
| # Update frontend environment with new backend URL | |
| echo "VITE_API_URL=${{ steps.deploy-backend.outputs.url }}" >> frontend/.env.production | |
| - name: Redeploy Frontend with Updated Environment | |
| if: success() | |
| uses: amondnet/vercel-action@v20 | |
| with: | |
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
| vercel-project-id: ${{ secrets.VERCEL_FRONTEND_PROJECT_ID }} | |
| working-directory: ./frontend | |
| vercel-args: '--prod' |