-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (51 loc) · 1.84 KB
/
Copy pathci.yml
File metadata and controls
62 lines (51 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: 🚀 CI Pipeline
# Kapan workflow ini berjalan:
# - Setiap push ke branch utama
# - Setiap pull_request yang menyasar main atau pr/*
on:
push:
branches:
- main
- 'dev' # Branch integrasi utama (langsung, bukan dev/xxx)
- 'dev/**' # Branch integrasi spesifik (dev/berita-filter, dll.)
- 'be/**'
- 'fe/**'
- 'hotfix/**' # Branch perbaikan darurat
pull_request:
branches:
- main
- 'dev' # PR yang menyasar branch dev
- 'dev/**' # PR yang menyasar branch dev/xxx
# Batalkan run lama jika ada push baru di branch yang sama
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: 🔍 Lint · TypeCheck · Build
runs-on: ubuntu-latest
env:
# Fallback ke nilai dummy agar prisma generate & build tidak gagal di CI
# Build tidak menyentuh DB karena semua page menggunakan force-dynamic
DATABASE_URL: ${{ secrets.DATABASE_URL || 'postgresql://ci:ci@localhost:5432/ci_db' }}
DIRECT_URL: ${{ secrets.DIRECT_URL || 'postgresql://ci:ci@localhost:5432/ci_db' }}
JWT_SECRET: ${{ secrets.JWT_SECRET || 'ci-jwt-secret-placeholder-64-chars-long-for-build-only-ok' }}
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL || 'https://localhost:3000' }}
steps:
- name: 📥 Checkout kode
uses: actions/checkout@v4
- name: 🟢 Setup Node.js 20
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
- name: 🔍 Lint (ESLint)
run: npm run lint
- name: 🔷 TypeScript type check
run: npx tsc --noEmit
- name: 🏗️ Build Next.js
run: npm run build