Reuse artifact
This commit is contained in:
parent
623657a9d1
commit
7f4d7517cd
2 changed files with 9 additions and 22 deletions
11
.github/workflows/build_docker_images.yml
vendored
11
.github/workflows/build_docker_images.yml
vendored
|
@ -21,15 +21,15 @@ jobs:
|
|||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-m2
|
||||
- name: Build with maven
|
||||
run: mvn package -DskipTests -Dbuild-version="${SEBSERVER_VERSION}"
|
||||
- run: mkdir staging && cp target/*.jar staging
|
||||
run: mvn package -DskipTests -Dbuild-version="auto"
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Package
|
||||
path: staging
|
||||
path: target/seb-server-.jar
|
||||
|
||||
docker_push:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
-
|
||||
name: Set up QEMU
|
||||
|
@ -43,6 +43,11 @@ jobs:
|
|||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Download a single artifact
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: Package
|
||||
-
|
||||
name: Build and push
|
||||
id: docker_build
|
||||
|
|
|
@ -1,21 +1,3 @@
|
|||
FROM alpine/git
|
||||
|
||||
ARG SEBSERVER_VERSION
|
||||
ARG GIT_TAG="v${SEBSERVER_VERSION}"
|
||||
|
||||
WORKDIR /sebserver
|
||||
RUN if [ "x${GIT_TAG}" = "x" ] ; \
|
||||
then git clone --depth 1 https://github.com/SafeExamBrowser/seb-server.git ; \
|
||||
else git clone -b "$GIT_TAG" --depth 1 https://github.com/SafeExamBrowser/seb-server.git ; fi
|
||||
|
||||
FROM maven:latest
|
||||
|
||||
ARG SEBSERVER_VERSION
|
||||
|
||||
WORKDIR /sebserver
|
||||
COPY --from=0 /sebserver/seb-server /sebserver
|
||||
RUN mvn clean install -DskipTests -Dbuild-version="${SEBSERVER_VERSION}"
|
||||
|
||||
FROM openjdk:11-jre-stretch
|
||||
|
||||
ARG SEBSERVER_VERSION
|
||||
|
@ -26,7 +8,7 @@ ENV SERVER_PWD=
|
|||
|
||||
|
||||
WORKDIR /sebserver
|
||||
COPY --from=1 /sebserver/target/seb-server-"${SEBSERVER_JAR}".jar /sebserver
|
||||
COPY --from=1 target/seb-server-auto.jar /sebserver
|
||||
|
||||
ENTRYPOINT exec java \
|
||||
-Dcom.sun.management.jmxremote \
|
||||
|
|
Loading…
Add table
Reference in a new issue