From 82c5fe477760c4d3ff7276f9b7072bf869bad28e Mon Sep 17 00:00:00 2001 From: Krywion Date: Wed, 8 Apr 2026 20:44:11 +0200 Subject: [PATCH 1/5] ci: add GitHub Actions workflow with build, test and docker jobs --- .github/workflows/ci.yml | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..debb5fb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,64 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build-and-test: + name: Build & Test + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + # --- Backend --- + - name: Set up Java 25 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '25' + cache: maven + cache-dependency-path: skyroster-backend/pom.xml + + - name: Backend - verify (compile + test + coverage) + working-directory: skyroster-backend + run: ./mvnw verify + + # --- Frontend --- + - name: Set up Node.js 22 + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: npm + cache-dependency-path: skyroster-frontend/package-lock.json + + - name: Frontend - install dependencies + working-directory: skyroster-frontend + run: npm ci + + - name: Frontend - lint + working-directory: skyroster-frontend + run: npm run lint + + - name: Frontend - build + working-directory: skyroster-frontend + run: npm run build + + docker: + name: Docker Build + runs-on: ubuntu-latest + needs: build-and-test + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build backend image + run: docker build -t skyroster-backend ./skyroster-backend + + - name: Build frontend image + run: docker build -t skyroster-frontend ./skyroster-frontend From ea71a9da7147661fd9285a0afdf5cb3dd0c227d9 Mon Sep 17 00:00:00 2001 From: Krywion Date: Wed, 8 Apr 2026 20:46:37 +0200 Subject: [PATCH 2/5] ci: run lint without --fix in CI to detect violations --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index debb5fb..f03d730 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: - name: Frontend - lint working-directory: skyroster-frontend - run: npm run lint + run: npx oxlint . && npx eslint . - name: Frontend - build working-directory: skyroster-frontend From cf5dc5e48668b760fde2c31de9445aefa7491a98 Mon Sep 17 00:00:00 2001 From: Krywion Date: Wed, 8 Apr 2026 20:47:07 +0200 Subject: [PATCH 3/5] ci: add backend Dockerfile with multi-stage build --- skyroster-backend/.dockerignore | 4 ++++ skyroster-backend/Dockerfile | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 skyroster-backend/.dockerignore create mode 100644 skyroster-backend/Dockerfile diff --git a/skyroster-backend/.dockerignore b/skyroster-backend/.dockerignore new file mode 100644 index 0000000..46bfc50 --- /dev/null +++ b/skyroster-backend/.dockerignore @@ -0,0 +1,4 @@ +target/ +.idea/ +*.iml +.git/ diff --git a/skyroster-backend/Dockerfile b/skyroster-backend/Dockerfile new file mode 100644 index 0000000..4e6abc1 --- /dev/null +++ b/skyroster-backend/Dockerfile @@ -0,0 +1,22 @@ +# Stage 1: Build +FROM eclipse-temurin:25-jdk AS build +WORKDIR /app + +# Copy Maven wrapper and POM for dependency caching +COPY .mvn/ .mvn/ +COPY mvnw pom.xml ./ +RUN chmod +x mvnw && ./mvnw dependency:go-offline -B + +# Copy source and build (skip tests — they ran in CI job 1) +COPY src/ src/ +RUN ./mvnw package -DskipTests -B + +# Stage 2: Runtime +FROM eclipse-temurin:25-jre +WORKDIR /app + +COPY --from=build /app/target/*.jar app.jar + +EXPOSE 8001 + +ENTRYPOINT ["java", "-jar", "app.jar"] From 79f8d23b8cb6cbbbb6115ddb58b3a6a4a48d0f47 Mon Sep 17 00:00:00 2001 From: Krywion Date: Wed, 8 Apr 2026 20:50:32 +0200 Subject: [PATCH 4/5] ci: add frontend Dockerfile with nginx and SPA fallback --- skyroster-frontend/.dockerignore | 3 +++ skyroster-frontend/Dockerfile | 16 ++++++++++++++++ skyroster-frontend/nginx.conf | 22 ++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 skyroster-frontend/.dockerignore create mode 100644 skyroster-frontend/Dockerfile create mode 100644 skyroster-frontend/nginx.conf diff --git a/skyroster-frontend/.dockerignore b/skyroster-frontend/.dockerignore new file mode 100644 index 0000000..ac33e3c --- /dev/null +++ b/skyroster-frontend/.dockerignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +.git/ diff --git a/skyroster-frontend/Dockerfile b/skyroster-frontend/Dockerfile new file mode 100644 index 0000000..584b8ee --- /dev/null +++ b/skyroster-frontend/Dockerfile @@ -0,0 +1,16 @@ +# Stage 1: Build +FROM node:22-alpine AS build +WORKDIR /app + +COPY package.json package-lock.json ./ +RUN npm ci + +COPY . . +RUN npm run build + +# Stage 2: Runtime +FROM nginx:alpine +COPY --from=build /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 diff --git a/skyroster-frontend/nginx.conf b/skyroster-frontend/nginx.conf new file mode 100644 index 0000000..5719e3e --- /dev/null +++ b/skyroster-frontend/nginx.conf @@ -0,0 +1,22 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + # SPA fallback — all routes to index.html + location / { + try_files $uri $uri/ /index.html; + } + + # Cache static assets + location /assets/ { + expires 1y; + add_header Cache-Control "public, immutable"; + } + + # Gzip + gzip on; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml; + gzip_min_length 256; +} From 25983766fd67d22e1fc4271019f56ba3662bc93d Mon Sep 17 00:00:00 2001 From: Krywion Date: Wed, 8 Apr 2026 20:57:27 +0200 Subject: [PATCH 5/5] ci: fix mvnw permission denied on Linux runner --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f03d730..aa497e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - name: Backend - verify (compile + test + coverage) working-directory: skyroster-backend - run: ./mvnw verify + run: chmod +x mvnw && ./mvnw verify # --- Frontend --- - name: Set up Node.js 22