Skip to content

Commit 9ddd2b9

Browse files
authored
ci: Switched to Dockerfile image build (#54)
1 parent 3c08141 commit 9ddd2b9

File tree

6 files changed

+90
-31
lines changed

6 files changed

+90
-31
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
src
1+
!/target/*.jar

.github/workflows/build.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- test/*
8+
tags:
9+
- "[0-9]+.[0-9]+.[0-9]+"
10+
pull_request:
11+
branches: [ master ]
12+
13+
jobs:
14+
build:
15+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Set up JDK 11
22+
uses: actions/setup-java@v2
23+
with:
24+
java-version: '11'
25+
distribution: 'adopt'
26+
cache: maven
27+
28+
- name: Build with Maven
29+
run: >
30+
./mvnw
31+
-B
32+
package
33+
34+
- name: Docker meta
35+
id: meta
36+
uses: docker/metadata-action@v3
37+
with:
38+
# list of Docker images to use as base name for tags
39+
images: |
40+
itzg/kidsbank-js
41+
42+
- name: Set up QEMU
43+
uses: docker/setup-qemu-action@v1
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v1
47+
48+
- name: Login to DockerHub
49+
if: github.event_name != 'pull_request'
50+
uses: docker/login-action@v1
51+
with:
52+
username: ${{ secrets.DOCKER_USER }}
53+
password: ${{ secrets.DOCKER_PASSWORD }}
54+
55+
- name: Build and push
56+
uses: docker/build-push-action@v2
57+
with:
58+
context: .
59+
push: ${{ github.event_name != 'pull_request' }}
60+
tags: ${{ steps.meta.outputs.tags }}
61+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/maven.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/prepare-release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Prepare release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release:
7+
description: Version to release
8+
required: true
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Set up JDK
17+
uses: actions/setup-java@v2
18+
with:
19+
java-version: '11'
20+
distribution: 'adopt'
21+
cache: maven
22+
23+
- name: Prepare release
24+
run: |
25+
git config --local user.name "Github Actions"
26+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
27+
./mvnw -B release:prepare -DreleaseVersion=${{ github.event.inputs.release }}

mvnw

100644100755
File mode changed.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
</repositories>
148148

149149
<build>
150-
<finalName>${artifactId}</finalName>
150+
<finalName>${project.artifactId}</finalName>
151151
<plugins>
152152
<plugin>
153153
<groupId>org.springframework.boot</groupId>

0 commit comments

Comments
 (0)