Sprint 2B — TimescaleDB, Data Quality, auto-sync match, augments #385
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 | |
| on: | |
| pull_request: | |
| branches: [main, develop] | |
| push: | |
| branches: [main, develop] | |
| jobs: | |
| ci: | |
| name: Type-check & Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate Prisma Client | |
| run: npx prisma generate --schema=workers/data-sync/prisma/schema.prisma | |
| - name: Type-check | |
| run: npx tsc --noEmit | |
| - name: Run tests | |
| run: npx vitest run | |
| deploy: | |
| name: Deploy to production | |
| runs-on: ubuntu-latest | |
| needs: ci | |
| # Only deploy when a sprint PR is merged into main | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| environment: | |
| name: production | |
| url: https://riftline.app | |
| steps: | |
| - name: Deploy via SSH | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.SERVER_IP }} | |
| username: root | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| script: | | |
| set -e | |
| cd /var/opt/riftline/app | |
| echo "→ Pulling latest code..." | |
| git fetch origin | |
| git reset --hard origin/main | |
| echo "→ Installing dependencies..." | |
| npm install --prefer-offline | |
| echo "→ Generating Prisma client..." | |
| npx prisma generate --schema=workers/data-sync/prisma/schema.prisma | |
| echo "→ Building frontend..." | |
| cd apps/web && npm run build && cd ../.. | |
| echo "→ Restarting API..." | |
| pm2 restart riftline-api --update-env | |
| echo "✓ Deploy complete — https://riftline.app" |