File tree Expand file tree Collapse file tree 5 files changed +100
-0
lines changed
Expand file tree Collapse file tree 5 files changed +100
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Compile Java Backend
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ compile-backend :
7+ runs-on : ubuntu-latest
8+ name : Compile Backend Code
9+ steps :
10+ - uses : actions/checkout@v3
11+
12+ - name : Set up JDK
13+ uses : actions/setup-java@v4
14+ with :
15+ distribution : ' temurin'
16+ java-version : ' 17'
17+
18+ - name : Compile with Maven
19+ run : |
20+ cd app
21+ mvn clean compile
22+
Original file line number Diff line number Diff line change 1+ name : Lint Java Backend
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ lint-java :
7+ runs-on : ubuntu-latest
8+ name : Checkstyle Java Linting
9+ steps :
10+ - uses : actions/checkout@v3
11+
12+ - name : Set up JDK
13+ uses : actions/setup-java@v4
14+ with :
15+ distribution : ' temurin'
16+ java-version : ' 17'
17+
18+ - name : Download Checkstyle
19+ run : curl -L -o checkstyle.jar https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.12.1/checkstyle-10.12.1-all.jar
20+
21+ - name : Run Checkstyle
22+ run : |
23+ java -jar checkstyle.jar -c /google_checks.xml app/src/main/java/com/project/back_end || true
Original file line number Diff line number Diff line change 1+ name : Lint Dockerfiles
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ dockerlint :
7+ runs-on : ubuntu-latest
8+ name : Lint Dockerfiles
9+ steps :
10+ - uses : actions/checkout@v3
11+
12+ - name : Run hadolint
13+ 14+ with :
15+ dockerfile : ./app/Dockerfile
Original file line number Diff line number Diff line change 1+ name : Lint Frontend
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ lint-frontend :
7+ runs-on : ubuntu-latest
8+ name : Lint HTML, CSS, and JS
9+ steps :
10+ - uses : actions/checkout@v3
11+
12+ - name : Set up Node.js
13+ uses : actions/setup-node@v4
14+ with :
15+ node-version : ' 18'
16+
17+ - name : Install linters
18+ run : |
19+ npm install -g htmlhint stylelint eslint
20+
21+ - name : Lint HTML
22+ run : htmlhint app/src/main/resources/static/assets/pages//*.html || true
23+
24+ - name : Lint CSS
25+ run : stylelint "app/src/main/resources/static/assets/css//*.css" || true
26+
27+ - name : Lint JS
28+ run : eslint app/src/main/resources/static/assets/js//*.js || true
Original file line number Diff line number Diff line change 1+ # Step 1: Use Maven with JDK 17 to build the app
2+ FROM maven:3.9.9-eclipse-temurin-17 AS builder
3+ WORKDIR /app
4+ COPY pom.xml .
5+ COPY src ./src
6+ RUN mvn clean package -DskipTests
7+ # Step 2: Use lightweight JRE 17 for running the app
8+ FROM eclipse-temurin:17.0.15_6-jre
9+ WORKDIR /app
10+ COPY --from=builder /app/target/back-end-0.0.1-SNAPSHOT.jar app.jar
11+ EXPOSE 8080
12+ ENTRYPOINT ["java" , "-jar" , "app.jar" ]
You can’t perform that action at this time.
0 commit comments