Skip to content

Commit babb70d

Browse files
authored
Update and rename gradle-publish.yml to build-and-deploy.yml
1 parent dccb067 commit babb70d

2 files changed

Lines changed: 48 additions & 46 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build and Deploy Java Modules
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
module: [allocations, base, deadlock, highcpu, hotmethods, latencies, memoryleak, memoryref, threadleak]
15+
steps:
16+
# Step 1: Checkout the repository
17+
- name: Checkout Repository
18+
uses: actions/checkout@v3
19+
20+
# Step 2: Set up Java environment
21+
- name: Set up JDK 11
22+
uses: actions/setup-java@v3
23+
with:
24+
java-version: 11
25+
distribution: temurin
26+
27+
# Step 3: Build the application
28+
- name: Build Maven Module
29+
run: |
30+
mvn clean package -pl ${{ matrix.module }} -am -DskipTests
31+
32+
# Step 4: Build Docker image
33+
- name: Build Docker Image
34+
run: |
35+
docker build \
36+
--build-arg module=${{ matrix.module }} \
37+
-t your-dockerhub-username/${{ matrix.module }} .
38+
39+
# Step 5: Push Docker Image to Docker Hub
40+
- name: Login to Docker Hub
41+
uses: docker/login-action@v2
42+
with:
43+
username: ${{ secrets.DOCKER_USERNAME }}
44+
password: ${{ secrets.DOCKER_PASSWORD }}
45+
46+
- name: Push Docker Image
47+
run: |
48+
docker push your-dockerhub-username/${{ matrix.module }}

.github/workflows/gradle-publish.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)