Skip to content

Commit d0f96b8

Browse files
committed
add commands for pushing image to docker hub
1 parent e13c7e2 commit d0f96b8

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/main.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Setup for Jdk 21
15+
uses: actions/setup-java@v2
16+
with:
17+
java-version: "21"
18+
distribution: "temurin"
19+
cache: maven
20+
- name: test
21+
run: mvn test
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Setup for Jdk 21
27+
uses: actions/setup-java@v2
28+
with:
29+
java-version: "21"
30+
distribution: "temurin"
31+
cache: maven
32+
- name: build
33+
run: mvn package
34+
build-docker-image:
35+
needs: [test, build]
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: docker/login-action@v3
39+
with:
40+
username: ${{ secrets.DOCKER_USERNAME }}
41+
password: ${{ secrets.DOCKER_PASSWORD }}
42+
- name: Build and push Docker images
43+
uses: docker/build-push-action@v5
44+
with:
45+
context: .
46+
file: ./Dockerfile
47+
push: true
48+
tags: ${{ secrets.DOCKER_USERNAME }}/aws-integration:latest

0 commit comments

Comments
 (0)