Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ frontend/build/
.git/
.agents/
.vscode/
**/.env
**/.env.docker
**/.env.prod
**/.env.*
!**/.env.example
68 changes: 68 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and Release Docker Images

on:
push:
tags:
- 'v*' # Memicu alur kerja setiap kali melakukan push tag seperti v1.0.0, v2.1.3, dll.

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Login ke GitHub Container Registry menggunakan token otomatis bawaan GitHub
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# ─── BUILD & PUSH BACKEND ──────────────────────────────────────────────────
- name: Extract Backend Metadata
id: meta-backend
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}-backend
tags: |
type=semver,pattern={{version}}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}

- name: Build and Push Backend Image
uses: docker/build-push-action@v5
with:
context: ./backend
push: true
tags: ${{ id.meta-backend.outputs.tags }}
labels: ${{ id.meta-backend.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

# ─── BUILD & PUSH FRONTEND ─────────────────────────────────────────────────
- name: Extract Frontend Metadata
id: meta-frontend
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}-frontend
tags: |
type=semver,pattern={{version}}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}

- name: Build and Push Frontend Image
uses: docker/build-push-action@v5
with:
context: ./frontend
push: true
tags: ${{ id.meta-frontend.outputs.tags }}
labels: ${{ id.meta-frontend.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
28 changes: 17 additions & 11 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,30 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install ESLint
run: |
npm install eslint@8.10.0
npm install @microsoft/eslint-formatter-sarif@3.1.0
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 11

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: backend/pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: backend

- name: Run ESLint
env:
SARIF_ESLINT_IGNORE_SUPPRESSED: "true"
# fix: Menambahkan backslash (\) untuk menyambung perintah ke baris berikutnya
run: npx eslint . \
--config .eslintrc.js \
--ext .js,.jsx,.ts,.tsx \
--format @microsoft/eslint-formatter-sarif \
--output-file eslint-results.sarif
run: pnpm exec eslint "{src,apps,libs,test}/**/*.ts" --format @microsoft/eslint-formatter-sarif --output-file ../eslint-results.sarif
working-directory: backend
continue-on-error: true

- name: Upload analysis results to GitHub
# fix: Mengubah versi v3 menjadi v4 sesuai instruksi peringatan
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: eslint-results.sarif
Expand Down
7 changes: 7 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
dist
.env
.env.docker
.env.prod
.env.*
!.env.example
3 changes: 2 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"@nestjs/schedule": "^6.1.3",
"@nestjs/websockets": "^11.1.19",
"@prisma/client": "^6.19.3",
"prisma": "^6.19.3",
"bcrypt": "^6.0.0",
"bull": "^4.16.5",
"cassandra-driver": "^4.9.0",
Expand All @@ -47,6 +46,7 @@
"minio": "^8.0.7",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"prisma": "^6.19.3",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"socket.io": "^4.8.3",
Expand All @@ -55,6 +55,7 @@
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.18.0",
"@microsoft/eslint-formatter-sarif": "^3.1.0",
"@nestjs/cli": "^11.0.0",
"@nestjs/schematics": "^11.0.0",
"@nestjs/testing": "^11.0.1",
Expand Down
Loading
Loading