Skip to content

Commit cdf7205

Browse files
committed
added docker push
1 parent 9c6e67b commit cdf7205

3 files changed

Lines changed: 6 additions & 21 deletions

File tree

.github/workflows/pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: "pre-release"
44
on:
55
push:
66
branches:
7-
- "*"
7+
- "main"
88

99
jobs:
1010
pre-release:

.github/workflows/release.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,8 @@ jobs:
2828
with:
2929
username: ${{ secrets.DOCKER_HUB_USERNAME }}
3030
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
31-
- name: Build Docker Image
32-
run: mvn spring-boot:build-image -Pdocker -DskipTests
33-
- name: Docker metadata
34-
id: metadata
35-
uses: docker/metadata-action@v3
36-
with:
37-
images: dedicatedcode/reitti
38-
tags: |
39-
type=semver,pattern={{version}}
40-
type=semver,pattern={{major}}.{{minor}}
41-
type=raw,value={{sha}},enable=${{ github.ref_type != 'tag' }}
42-
- name: Tag image
43-
run: docker image tag dedicatedcode/reitti ${{ inputs.tags }}
44-
with:
45-
tags: ${{ steps.metadata.outputs.tags }}
46-
- name: Push images
47-
run: docker push --all-tags dedicatedcode/reitti:tagname
48-
49-
31+
- name: Build & Publish Latest Docker Image
32+
run: mvn spring-boot:build-image -Pdocker -DskipTests -Ddocker.tag=latest
5033
- uses: "marvinpinto/action-automatic-releases@latest"
5134
with:
5235
repo_token: "${{ secrets.GITHUB_TOKEN }}"

pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<name>reitti</name>
1515
<description>Reitti application</description>
1616
<properties>
17+
<docker.tag>latest</docker.tag>
1718
<java.version>24</java.version>
1819
<argLine/>
1920
<testcontainers.version>1.19.5</testcontainers.version>
@@ -158,14 +159,15 @@
158159
<artifactId>spring-boot-maven-plugin</artifactId>
159160
<configuration>
160161
<image>
161-
<name>dedicatedcode/reitti:latest</name>
162+
<name>dedicatedcode/reitti:${docker.tag}</name>
162163
<env>
163164
<BP_JVM_VERSION>24</BP_JVM_VERSION>
164165
</env>
165166
</image>
166167
<layers>
167168
<enabled>true</enabled>
168169
</layers>
170+
<publish>true</publish>
169171
</configuration>
170172
<executions>
171173
<execution>

0 commit comments

Comments
 (0)