Build using GH actions

This commit is contained in:
RaphiMC 2024-06-29 14:57:00 +02:00
parent ca4014f130
commit d5d44806a9
No known key found for this signature in database
GPG key ID: 0F6BB0657A03AC94
2 changed files with 13 additions and 10 deletions

View file

@ -14,6 +14,16 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
check-latest: true
- name: Build with Gradle
run: ./gradlew build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}

View file

@ -1,11 +1,4 @@
FROM --platform=$BUILDPLATFORM gradle:jdk17 as builder
WORKDIR /build
COPY build.gradle settings.gradle gradle.properties ./
COPY .git .git
COPY src src
RUN gradle --no-daemon build
FROM --platform=$TARGETPLATFORM eclipse-temurin:21-jre-alpine
WORKDIR /app
COPY --from=builder /build/build/libs/ViaProxy-*.jar ViaProxy.jar
ENTRYPOINT ["java", "-jar", "ViaProxy.jar"]
WORKDIR /app/run
COPY /build/libs/ViaProxy-*.jar /app/ViaProxy.jar
ENTRYPOINT ["java", "-jar", "/app/ViaProxy.jar", "config", "viaproxy.yml"]