name: Main Branch Deploy on: push: branches: [main] jobs: test-build-deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "24" cache: "npm" - name: Install dependencies run: npm ci - name: Security audit run: npm audit --audit-level=high - name: Run type checking run: npm run check - name: Run linting run: npm run lint - name: Run unit tests run: npm run test:unit -- --run env: DATABASE_URL: "postgresql://test:test@localhost:5432/test" SMTP_HOST: "smtp.example.com" SMTP_PORT: "587" SMTP_SECURE: "false" SMTP_USER: "your-email@example.com" SMTP_PASS: "your-password" SMTP_FROM_NAME: "Open Reception" SMTP_FROM_EMAIL: "noreply@example.com" JWT_SECRET: "test" - name: Build application run: npm run build env: DATABASE_URL: "postgresql://test:test@localhost:5432/test" SMTP_HOST: "smtp.example.com" SMTP_PORT: "587" SMTP_SECURE: "false" SMTP_USER: "your-email@example.com" SMTP_PASS: "your-password" SMTP_FROM_NAME: "Open Reception" SMTP_FROM_EMAIL: "noreply@example.com" JWT_SECRET: "test" - name: Install Playwright browsers run: npx playwright install --with-deps - name: Run E2E tests run: npm run test:e2e env: DATABASE_URL: "postgresql://test:test@localhost:5432/test" SMTP_HOST: "smtp.example.com" SMTP_PORT: "587" SMTP_SECURE: "false" SMTP_USER: "your-email@example.com" SMTP_PASS: "your-password" SMTP_FROM_NAME: "Open Reception" SMTP_FROM_EMAIL: "noreply@example.com" JWT_SECRET: "test"