mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Merge pull request #368 from TeamPiped/dockerless-build
Build outside docker for faster builds.
This commit is contained in:
commit
243926c60e
4 changed files with 73 additions and 67 deletions
93
.github/workflows/docker-build.yml
vendored
93
.github/workflows/docker-build.yml
vendored
|
@ -8,93 +8,52 @@ on:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-docker-hotspot:
|
build-docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- image: 1337kavin/piped:latest,1337kavin/piped:openj9
|
||||||
|
dockerfile: ./Dockerfile.openj9.ci
|
||||||
|
- image: 1337kavin/piped:hotspot
|
||||||
|
dockerfile: ./Dockerfile.ci
|
||||||
|
- image: 1337kavin/piped:graalvm-jvm
|
||||||
|
dockerfile: ./Dockerfile.graalvm-jvm.ci
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Create Version File
|
- name: Create Version File
|
||||||
run: echo $(git log -1 --date=short --pretty=format:%cd)-$(git rev-parse --short HEAD) > VERSION
|
run: echo $(git log -1 --date=short --pretty=format:%cd)-$(git rev-parse --short HEAD) > VERSION
|
||||||
|
- name: set up JDK ${{ matrix.java }}
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: ${{ matrix.java }}
|
||||||
|
distribution: temurin
|
||||||
|
check-latest: true
|
||||||
|
cache: "gradle"
|
||||||
|
- name: Run Build
|
||||||
|
run: ./gradlew build
|
||||||
|
- run: mv build/libs/piped-*-all.jar piped.jar
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.0.0
|
uses: docker/setup-qemu-action@v2
|
||||||
with:
|
with:
|
||||||
platforms: all
|
platforms: all
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.0.0
|
uses: docker/setup-buildx-action@v2
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v2.0.0
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v3.1.1
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ${{ matrix.dockerfile }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: 1337kavin/piped:hotspot
|
tags: ${{ matrix.image }}
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
build-docker-openj9:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Create Version File
|
|
||||||
run: echo $(git log -1 --date=short --pretty=format:%cd)-$(git rev-parse --short HEAD) > VERSION
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2.0.0
|
|
||||||
with:
|
|
||||||
platforms: all
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v2.0.0
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v2.0.0
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v3.1.1
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile.openj9
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: 1337kavin/piped:latest,1337kavin/piped:openj9
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
build-docker-graalvm:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Create Version File
|
|
||||||
run: echo $(git log -1 --date=short --pretty=format:%cd)-$(git rev-parse --short HEAD) > VERSION
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2.0.0
|
|
||||||
with:
|
|
||||||
platforms: all
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v2.0.0
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v2.0.0
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v3.1.1
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile.graalvm-jvm
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: 1337kavin/piped:graalvm-jvm
|
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
11
Dockerfile.ci
Normal file
11
Dockerfile.ci
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
FROM eclipse-temurin:17-jre
|
||||||
|
|
||||||
|
WORKDIR /app/
|
||||||
|
|
||||||
|
COPY ./piped.jar /app/piped.jar
|
||||||
|
|
||||||
|
COPY VERSION .
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
CMD java -jar /app/piped.jar
|
25
Dockerfile.graalvm-jvm.ci
Normal file
25
Dockerfile.graalvm-jvm.ci
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
FROM ghcr.io/graalvm/native-image:latest as build
|
||||||
|
|
||||||
|
RUN jlink \
|
||||||
|
--add-modules java.base,java.logging,java.sql,java.management,java.xml,java.naming,java.desktop,jdk.crypto.ec \
|
||||||
|
--strip-debug \
|
||||||
|
--no-man-pages \
|
||||||
|
--no-header-files \
|
||||||
|
--compress=2 \
|
||||||
|
--output /javaruntime
|
||||||
|
|
||||||
|
FROM debian:stable-slim
|
||||||
|
|
||||||
|
ENV JAVA_HOME=/opt/java/openjdk
|
||||||
|
ENV PATH "${JAVA_HOME}/bin:${PATH}"
|
||||||
|
COPY --from=build /javaruntime $JAVA_HOME
|
||||||
|
|
||||||
|
WORKDIR /app/
|
||||||
|
|
||||||
|
COPY ./piped.jar /app/piped.jar
|
||||||
|
|
||||||
|
COPY VERSION .
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
CMD java -jar /app/piped.jar
|
11
Dockerfile.openj9.ci
Normal file
11
Dockerfile.openj9.ci
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
FROM ibm-semeru-runtimes:open-17-jre
|
||||||
|
|
||||||
|
WORKDIR /app/
|
||||||
|
|
||||||
|
COPY ./piped.jar /app/piped.jar
|
||||||
|
|
||||||
|
COPY VERSION .
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
CMD java -server -XX:+UnlockExperimentalVMOptions -XX:+OptimizeStringConcat -XX:+UseStringDeduplication -XX:+UseCompressedOops -XX:+UseNUMA -XX:+UseParallelGC -XX:-UseBiasedLocking -Xshareclasses:allowClasspaths -jar /app/piped.jar
|
Loading…
Reference in a new issue