Skip to content

Commit 4277535

Browse files
Update main.yml
1 parent ce231cc commit 4277535

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
name: CI Workflow for Build
1+
name: CI Workflow for Docker Build
22
on:
33
push:
44
jobs:
55
endproject:
6+
env:
7+
appName: "docker-image"
68
runs-on: ubuntu-latest
79
steps:
810
- name: Checkout
911
uses: actions/checkout@v3
12+
- name: Set up Docker Buildx
13+
uses: docker/setup-buildx-action@v2
1014
- name: Set up JDK 11
1115
uses: actions/setup-java@v3
1216
with:
@@ -15,3 +19,14 @@ jobs:
1519
cache: maven
1620
- name: Build with Maven
1721
run: mvn -B package --file pom.xml
22+
- name: Login to Docker Hub
23+
uses: docker/login-action@v2
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
- name: Build and push
28+
uses: docker/build-push-action@v4
29+
with:
30+
context: .
31+
push: true
32+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.appName }}:latest

0 commit comments

Comments
 (0)