-
Notifications
You must be signed in to change notification settings - Fork 43
87 lines (72 loc) · 2.42 KB
/
maven.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
name: build & packaging
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
java-version: [17]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK ${{matrix.java-version}}
uses: actions/setup-java@v2
with:
distribution: temurin
cache: maven
java-version: ${{matrix.java-version}}
- name: License check
run: mvn -B license:check
- name: Build, test, package
run: mvn -U -B clean package install
- name: Copy artifacts to docker dir
run: |
cp iam-login-service/target/iam-login-service.war iam-login-service/docker
cp iam-test-client/target/iam-test-client.jar iam-test-client/docker
- name: Generate buildpacks
run: mvn -DskipTests -U -B spring-boot:build-image
- name: Docker login
if: startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Publish buildpacks on Dockerhub
if: startsWith(github.ref, 'refs/tags/')
env:
DEBUG: y
run: ./utils/tag-push-images.sh ${GITHUB_REF#refs/tags/}
- name: Docker metainformation for iam-login-service
id: ls-meta
uses: docker/metadata-action@v3
with:
images: indigoiam/iam-login-service
tags: |
type=sha
type=ref,event=tag
- name: Docker metainformation for iam-test-client
id: tc-meta
uses: docker/metadata-action@v3
with:
images: indigoiam/iam-test-client
tags: |
type=sha
type=ref,event=tag
- name: Build & push iam-login-service docker image
uses: docker/build-push-action@v2
with:
tags: ${{ steps.ls-meta.outputs.tags }}
labels: ${{ steps.ls-meta.outputs.labels }}
context: iam-login-service/docker/
file: iam-login-service/docker/Dockerfile.prod
push: ${{ startsWith(github.ref, 'refs/tags/') }}
- name: Build & push iam-test-client docker image
uses: docker/build-push-action@v2
with:
tags: ${{ steps.tc-meta.outputs.tags }}
labels: ${{ steps.tc-meta.outputs.labels }}
context: iam-test-client/docker/
file: iam-test-client/docker/Dockerfile.prod
push: ${{ startsWith(github.ref, 'refs/tags/') }}