Merge branch 'main' of https://github.com/wareeshayyyyy/Connecto #1
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-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: '18' | |
| - name: Install Backend Dependencies | |
| working-directory: ./connecto-backend | |
| run: npm install | |
| - name: Install Frontend Dependencies | |
| working-directory: ./connecto-frontend | |
| run: npm install | |
| - name: Build Frontend | |
| working-directory: ./connecto-frontend | |
| run: npm run build | |
| deploy-frontend: | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install and Build Frontend | |
| working-directory: ./connecto-frontend | |
| run: | | |
| npm install | |
| npm run build | |
| - name: Deploy to Netlify | |
| uses: nwtgck/actions-netlify@v3.0 | |
| with: | |
| publish-dir: './connecto-frontend/dist' | |
| production-branch: main | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| deploy-message: "Deploy from GitHub Actions" | |
| alias: main | |
| env: | |
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
| NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
| timeout-minutes: 5 | |
| deploy-backend: | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| steps: | |
| - name: Trigger Backend Deployment | |
| run: | | |
| echo "Triggering deployment hook..." | |
| if [ -n "${{ secrets.RENDER_DEPLOY_HOOK }}" ]; then | |
| curl -X POST "${{ secrets.RENDER_DEPLOY_HOOK }}" | |
| else | |
| echo "No RENDER_DEPLOY_HOOK provided, skipping backend deployment via Actions." | |
| fi |