File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Java CI
2
+
3
+ on : [push]
4
+
5
+ jobs :
6
+ build :
7
+ runs-on : ubuntu-latest
8
+
9
+ steps :
10
+ - uses : actions/checkout@v3
11
+ - name : Set up JDK 17
12
+ uses : actions/setup-java@v3
13
+ with :
14
+ java-version : ' 17'
15
+ distribution : ' temurin'
16
+ - name : Build with Maven
17
+ run : mvn --batch-mode --update-snapshots package
Original file line number Diff line number Diff line change
1
+ name : Publish Docker image to Docker Hub
2
+ on :
3
+ release :
4
+ types :
5
+ - published
6
+
7
+ jobs :
8
+ publish :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - name : Login to Docker Hub
12
+ uses : docker/login-action@v2
13
+ with :
14
+ username : ${{secrets.DOCKER_USERNAME}}
15
+ password : ${{secrets.DOCKER_PASSWORD}}
16
+ - uses : actions/checkout@v3
17
+ - name : Set up Maven Central Repository
18
+ uses : actions/setup-java@v3
19
+ with :
20
+ java-version : ' 17'
21
+ distribution : ' adopt'
22
+ server-id : docker.io
23
+ server-username : DOCKER_USERNAME
24
+ server-password : DOCKER_PASSWORD
25
+ - name : Publish package
26
+ run : mvn --batch-mode -Prelease package dockerfile:push
27
+ env :
28
+ DOCKER_USERNAME : ${{secrets.DOCKER_USERNAME}}
29
+ DOCKER_TOKEN : ${{secrets.DOCKER_PASSWORD}}
You can’t perform that action at this time.
0 commit comments