name: CI on: push: branches: [master] pull_request: branches: [master] jobs: build: runs-on: ubuntu-latest services: postgres: image: postgres:16-alpine env: POSTGRES_USER: media POSTGRES_PASSWORD: media POSTGRES_DB: media ports: - 5432:5432 options: >- --health-cmd "pg_isready -U media" --health-interval 5s --health-timeout 5s --health-retries 10 env: DATABASE_URL: postgres://media:media@localhost:5432/media NEXTAUTH_SECRET: ci-secret-not-for-production NEXTAUTH_URL: http://localhost:3000 AUTO_ACTIVATE_NEW_USERS: "true" MAGIC_LINK_DEV_TRANSPORT: "true" ALLOW_DEV_RESET: "true" CRON_SECRET: ci-cron-secret steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: pnpm - uses: pnpm/action-setup@v4 with: version: 9 - name: Install run: pnpm install --frozen-lockfile - name: Install media tools run: sudo apt-get update && sudo apt-get install -y postgresql-client unzip ffmpeg - name: Migration drift check run: pnpm db:generate && git diff --exit-code -- drizzle - name: Typecheck run: pnpm typecheck - name: Lint run: pnpm lint - name: Test run: pnpm test - name: Apply migrations run: pnpm db:migrate - name: End-to-end run: pnpm test:e2e - name: Build run: pnpm build