Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build (master)

on:
push:
branches:
- master
tags-ignore:
- '**'
release:
types: [ published ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: ./mvnw -B package --file pom.xml
- uses: actions/cache@v2
id: target-cache
with:
path: ./target/*
key: ${{ github.sha }}

build_and_publish_docker_image:
name: Build and Publish Docker Image
runs-on: ubuntu-latest
needs: [ build ]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
id: target-cache
with:
path: ./target/*
key: ${{ github.sha }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get Project Version from POM
id: project-version
uses: CptMokoena/maven-get-version-action@1.0.3
- name: Build and Push (latest)
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: docker/build-push-action@v5
with:
context: .
file: ./src/main/resources/Dockerfile
build-args: |
JAR_FILE=self-information-${{ steps.project-version.outputs.version }}.jar
push: true
tags: stefankapferer/ost-self-information-app:latest
- name: Build and Push (latest)
if: github.event_name == 'release'
uses: docker/build-push-action@v5
with:
context: .
file: ./src/main/resources/Dockerfile
build-args: |
JAR_FILE=self-information-${{ steps.project-version.outputs.version }}.jar
push: true
tags: stefankapferer/ost-self-information-app:${{ github.event.release.tag_name }}
21 changes: 21 additions & 0 deletions .github/workflows/standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build (non-master branch)

on:
push:
branches-ignore:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: ./mvnw -B package --file pom.xml
4 changes: 2 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.3</version>
<version>2.7.18</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>ch.ost.cloudsolutions</groupId>
<artifactId>self-information</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.2--SNAPSHOT</version>
<name>self-information</name>
<description>Demo project for Spring Boot</description>

Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>5.1.1</version>
<version>5.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM openjdk:17-slim-buster

# add JAR file
ARG JAR_FILE
ADD target/${JAR_FILE} /srv/web/lib/self-information-app.jar

RUN mkdir /srv/web/tmp
RUN mkdir /srv/web/conf

ENV DEBUG_OPTS=""
ENV JAVA_OPTS=""

EXPOSE 8080
ENTRYPOINT exec java $DEBUG_OPTS $JAVA_OPTS -jar /srv/web/lib/self-information-app.jar --debug
2 changes: 1 addition & 1 deletion src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Self Information Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet"
th:href="@{/webjars/bootstrap/5.1.1/css/bootstrap.min.css}" />
th:href="@{/webjars/bootstrap/5.3.2/css/bootstrap.min.css}" />
</head>
<body>
<div class="container">
Expand Down