ci.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. name: ci
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. branches: [main]
  7. jobs:
  8. lint:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v4
  12. - name: Setup Node.js
  13. uses: actions/setup-node@v4
  14. with:
  15. node-version: "20"
  16. - name: Setup pnpm
  17. uses: pnpm/action-setup@v4
  18. with:
  19. version: 9
  20. - name: Get pnpm store directory
  21. shell: bash
  22. run: |
  23. echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
  24. - name: Setup pnpm cache
  25. uses: actions/cache@v4
  26. with:
  27. path: ${{ env.STORE_PATH }}
  28. key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
  29. restore-keys: |
  30. ${{ runner.os }}-pnpm-store-
  31. - name: Install dependencies
  32. run: pnpm install --frozen-lockfile
  33. - name: Generate Prisma client
  34. run: pnpm prisma generate
  35. - name: Run linting
  36. run: pnpm lint
  37. build:
  38. runs-on: ubuntu-latest
  39. steps:
  40. - uses: actions/checkout@v4
  41. - name: Setup Node.js
  42. uses: actions/setup-node@v4
  43. with:
  44. node-version: "20"
  45. - name: Setup pnpm
  46. uses: pnpm/action-setup@v4
  47. with:
  48. version: 9
  49. - name: Get pnpm store directory
  50. shell: bash
  51. run: |
  52. echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
  53. - name: Setup pnpm cache
  54. uses: actions/cache@v4
  55. with:
  56. path: ${{ env.STORE_PATH }}
  57. key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
  58. restore-keys: |
  59. ${{ runner.os }}-pnpm-store-
  60. - name: Install dependencies
  61. run: pnpm install --frozen-lockfile
  62. - name: Generate Prisma client
  63. run: pnpm prisma generate
  64. - name: Build project
  65. run: pnpm build
  66. env:
  67. BETTER_AUTH_URL: http://localhost:3000
  68. DATABASE_URL: postgresql://user:password@localhost:5432/test_db
  69. GOOGLE_CLIENT_ID: test_client_id
  70. GOOGLE_CLIENT_SECRET: test_client_secret
  71. RESEND_API_KEY: re_test_key
  72. BETTER_AUTH_SECRET: test_secret_key_32_chars_minimum
  73. OPENPANEL_SECRET_KEY: test_secret
  74. NEXT_PUBLIC_OPENPANEL_CLIENT_ID: test_client_id