-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (94 loc) · 3.41 KB
/
maven-docker-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Build and Push CI Pipeline
on:
push:
branches:
- '**'
pull_request:
branches:
- main
jobs:
build:
name: Build and Test with Maven
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Build with Maven
run: mvn --batch-mode clean install
- name: Upload Artifact codegen
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main'
uses: actions/upload-artifact@v4
with:
name: asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar
path: asmetal2java_codegen/target/asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar
retention-days: 1
- name: Upload Artifact asmgen
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main'
uses: actions/upload-artifact@v4
with:
name: asmetal2java_asmgen-0.0.1-SNAPSHOT-jar-with-dependencies.jar
path: asmetal2java_asmgen/target/asmetal2java_asmgen-0.0.1-SNAPSHOT-jar-with-dependencies.jar
retention-days: 1
docker_codegen:
name: Push codegen Docker Image
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar
path: ./asmetal2java_codegen/target
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push codegen
uses: docker/build-push-action@v6
with:
context: ./asmetal2java_codegen
dockerfile: ./asmetal2java_codegen/Dockerfile
push: true
tags: isaacmaffeis/asmetal2java_codegen:latest
- name: Delete Artifact
uses: GeekyEggo/delete-artifact@v5.1.0
with:
name: asmetal2java_codegen-0.0.1-SNAPSHOT-jar-with-dependencies.jar
docker_asmgen:
name: Push asmgen Docker Image
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: asmetal2java_asmgen-0.0.1-SNAPSHOT-jar-with-dependencies.jar
path: ./asmetal2java_asmgen/target
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./asmetal2java_asmgen
dockerfile: ./asmetal2java_asmgen/Dockerfile
push: true
tags: isaacmaffeis/asmetal2java_asmgen:latest
- name: Delete Artifact
uses: GeekyEggo/delete-artifact@v5.1.0
with:
name: asmetal2java_asmgen-0.0.1-SNAPSHOT-jar-with-dependencies.jar