Skip to content

Commit b9f07f3

Browse files
committed
update the main.yml deployment file
1 parent 1782c85 commit b9f07f3

File tree

1 file changed

+56
-45
lines changed

1 file changed

+56
-45
lines changed

.github/workflows/main.yml

Lines changed: 56 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,59 @@
11
on:
2-
push:
3-
branches:
4-
- main
5-
pull_request:
6-
branches:
7-
- main
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
branches:
7+
- main
88

99
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: ${{ github.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: ${{ github.DOCKER_USERNAME }}/aws-integration:latest
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: temurin
19+
java-version: "21"
20+
cache: maven
21+
22+
- name: Run tests
23+
run: mvn test
24+
25+
build:
26+
runs-on: ubuntu-latest
27+
needs: test
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Setup JDK 21
32+
uses: actions/setup-java@v4
33+
with:
34+
distribution: temurin
35+
java-version: "21"
36+
cache: maven
37+
38+
- name: Build JAR
39+
run: mvn package
40+
41+
build-docker-image:
42+
runs-on: ubuntu-latest
43+
needs: [build]
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Log in to Docker Hub
48+
uses: docker/login-action@v3
49+
with:
50+
username: ${{ secrets.DOCKER_USERNAME }}
51+
password: ${{ secrets.DOCKER_PASSWORD }}
52+
53+
- name: Build and push Docker image
54+
uses: docker/build-push-action@v5
55+
with:
56+
context: .
57+
file: ./Dockerfile
58+
push: true
59+
tags: ${{ secrets.DOCKER_USERNAME }}/aws-integration:latest

0 commit comments

Comments
 (0)