-
Notifications
You must be signed in to change notification settings - Fork 6
84 lines (71 loc) · 2.54 KB
/
bff_develop.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
# Build and package image for iris-client-bff and publish it to docker.io
# https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/htmlsingle/#build-image
name: BFF Develop
on:
push:
branches:
- develop
paths:
- iris-client-bff/**
- .github/workflows/bff_develop.yml
- .github/workflows/publish-test-results.yml@develop
- .github/workflows/trivy-container-scan.yml
pull_request:
branches:
- develop
jobs:
build_and_push:
name: Build and push to docker.io
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
image-ref: ${{ steps.meta.outputs.tags }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'liberica'
java-version: '17'
# There is an error since 12.04. when restoring the cache.
# cache: 'maven'
- name: Create image tag
id: meta
uses: docker/metadata-action@v4
with:
images: inoeg/iris-client-bff
- name: build, package and publish the image
run: |
mvn -B clean verify spring-boot:build-image -am -pl iris-client-bff -Dspring-boot.build-image.publish=false -Dimage.tag=${{ steps.meta.outputs.tags }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PW }}
- name: Sign and push docker image
uses: sudo-bot/action-docker-sign@latest
with:
image-ref: ${{steps.meta.outputs.tags}}
private-key-id: ${{ secrets.DOCKER_HUB_DCT_PRIVATE_KEY_IDENTIFIER }}
private-key: ${{ secrets.DOCKER_HUB_DCT_PRIVATE_KEY }}
private-key-passphrase: ${{ secrets.DOCKER_HUB_DCT_PASSPHRASE }}
- name: Upload Test Reports
if: always()
uses: actions/upload-artifact@v3
with:
name: test-reports
path: |
**/surefire-reports/*.xml
**/failsafe-reports/*.xml
!**/failsafe-reports/failsafe-summary.xml
publish-test-results:
name: Publish Test Results
needs: build_and_push
uses: iris-connect/iris-client/.github/workflows/publish-test-results.yml@develop
container_scan:
name: Container Scan
needs: build_and_push
uses: iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop
with:
image-refs: "[ '${{needs.build_and_push.outputs.image-ref}}' ]"