From d7e37ac754292fb85b3440e75190b34cdd0852bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9?= Date: Sun, 3 May 2026 21:26:35 +0200 Subject: [PATCH 1/4] feat : add build github ci --- .github/workflows/build-services.yml | 67 ++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/build-services.yml diff --git a/.github/workflows/build-services.yml b/.github/workflows/build-services.yml new file mode 100644 index 0000000..0211894 --- /dev/null +++ b/.github/workflows/build-services.yml @@ -0,0 +1,67 @@ +name: Build Services CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + frontend: + name: Frontend — Build + runs-on: ubuntu-latest + defaults: + run: + working-directory: apps/frontend + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + with: + version: latest + + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: pnpm + cache-dependency-path: apps/frontend/pnpm-lock.yaml + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm build + + backend: + name: Backend — Build + runs-on: ubuntu-latest + defaults: + run: + working-directory: apps/backend + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: temurin + cache: maven + + - name: Make mvnw executable + run: chmod +x ./mvnw + + - name: Build + run: ./mvnw package -DskipTests -B + + docker: + name: Docker — Build images + runs-on: ubuntu-latest + needs: [frontend, backend] + steps: + - uses: actions/checkout@v4 + + - name: Create env file + run: cp .env.example .env + + - name: Build images + run: docker compose build From 21ad2e479d5137426e736383cfc54e1f04ff86fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9?= Date: Sun, 3 May 2026 21:38:28 +0200 Subject: [PATCH 2/4] fix : coderabbit comments --- .github/workflows/build-services.yml | 5 +++-- apps/frontend/package.json | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-services.yml b/.github/workflows/build-services.yml index 0211894..c722da6 100644 --- a/.github/workflows/build-services.yml +++ b/.github/workflows/build-services.yml @@ -6,6 +6,9 @@ on: pull_request: branches: [main] +permissions: + contents: read + jobs: frontend: name: Frontend — Build @@ -17,8 +20,6 @@ jobs: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - with: - version: latest - uses: actions/setup-node@v4 with: diff --git a/apps/frontend/package.json b/apps/frontend/package.json index c9b07a2..35a2e48 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -2,6 +2,7 @@ "name": "frontend", "version": "0.1.0", "private": true, + "packageManager": "pnpm@9.15.0", "scripts": { "dev": "next dev", "build": "next build", From b7a79088565f2948a1eb5e9e793c9f148ec9256b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9?= Date: Sun, 3 May 2026 21:45:04 +0200 Subject: [PATCH 3/4] refactore : build on changes --- .github/workflows/build-services.yml | 27 +++++++++++++++++++++++++++ apps/frontend/package.json | 1 - 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-services.yml b/.github/workflows/build-services.yml index c722da6..de59b5f 100644 --- a/.github/workflows/build-services.yml +++ b/.github/workflows/build-services.yml @@ -10,8 +10,27 @@ permissions: contents: read jobs: + changes: + name: Detect changed paths + runs-on: ubuntu-latest + outputs: + frontend: ${{ steps.filter.outputs.frontend }} + backend: ${{ steps.filter.outputs.backend }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + frontend: + - 'apps/frontend/**' + backend: + - 'apps/backend/**' + frontend: name: Frontend — Build + needs: changes + if: needs.changes.outputs.frontend == 'true' runs-on: ubuntu-latest defaults: run: @@ -20,6 +39,8 @@ jobs: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 + with: + version: '9.15.0' - uses: actions/setup-node@v4 with: @@ -35,6 +56,8 @@ jobs: backend: name: Backend — Build + needs: changes + if: needs.changes.outputs.backend == 'true' runs-on: ubuntu-latest defaults: run: @@ -58,6 +81,10 @@ jobs: name: Docker — Build images runs-on: ubuntu-latest needs: [frontend, backend] + if: | + always() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') steps: - uses: actions/checkout@v4 diff --git a/apps/frontend/package.json b/apps/frontend/package.json index 35a2e48..c9b07a2 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -2,7 +2,6 @@ "name": "frontend", "version": "0.1.0", "private": true, - "packageManager": "pnpm@9.15.0", "scripts": { "dev": "next dev", "build": "next build", From 67834ec94e329baf383d6fba3f05a92f54d4c645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9?= Date: Sun, 3 May 2026 22:02:29 +0200 Subject: [PATCH 4/4] fix : coderabbit comment --- .github/workflows/build-services.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-services.yml b/.github/workflows/build-services.yml index de59b5f..f9487f3 100644 --- a/.github/workflows/build-services.yml +++ b/.github/workflows/build-services.yml @@ -84,7 +84,8 @@ jobs: if: | always() && !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') + !contains(needs.*.result, 'cancelled') && + (needs.frontend.result == 'success' || needs.backend.result == 'success') steps: - uses: actions/checkout@v4