Skip to content

Commit 3e2292b

Browse files
Added GitHub workflows
1 parent c9330d0 commit 3e2292b

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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}}

0 commit comments

Comments
 (0)