Skip to content

Commit 7fd5e40

Browse files
Create docker-image.yml
1 parent da781f9 commit 7fd5e40

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v3
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
cache: maven
23+
- name: Build with Maven
24+
run: mvn -B package --file pom.xml
25+
- name: Login to Docker Hub
26+
uses: docker/login-action@v3
27+
with:
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_TOKEN }}
30+
- name: Build and push
31+
uses: docker/build-push-action@v5
32+
with:
33+
context: .
34+
push: true
35+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/anuj-image:latest

0 commit comments

Comments
 (0)