-
-
Notifications
You must be signed in to change notification settings - Fork 26
149 lines (134 loc) · 5.25 KB
/
build-package.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: build-package
on:
push:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README*'
pull_request:
paths-ignore:
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'README*'
jobs:
build-package-contract-testing:
runs-on: ubuntu-latest
environment: Build
steps:
# Checkout repository content
- name: Checkout
uses: actions/checkout@v3
- name: Filter contract-testing
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
contract-testing:
- 'contract-testing-demo/**'
- name: Set up QEMU
if: github.repository_owner == 'microcks' && steps.changes.outputs.contract-testing == 'true'
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: github.repository_owner == 'microcks' && steps.changes.outputs.contract-testing == 'true'
uses: docker/setup-buildx-action@v2
- name: Login to Quay.io Registry and setup multi-arch builder
if: github.repository_owner == 'microcks' && steps.changes.outputs.contract-testing == 'true'
run: |
echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USERNAME }} --password-stdin quay.io
BUILDER=buildx-multi-arch
docker buildx inspect $BUILDER || docker buildx create --name=$BUILDER --driver=docker-container --driver-opt=network=host
- name: Build and push container image
if: github.repository_owner == 'microcks' && steps.changes.outputs.contract-testing == 'true'
run: |
cd contract-testing-demo
docker buildx build --push \
--platform=linux/amd64,linux/arm64 \
--builder=buildx-multi-arch \
--provenance=false \
--build-arg TAG=01 \
--file Dockerfile-01 \
--tag=quay.io/microcks/contract-testing-demo:01 .
docker buildx build --push \
--platform=linux/amd64,linux/arm64 \
--builder=buildx-multi-arch \
--provenance=false \
--build-arg TAG=02 \
--file Dockerfile-02 \
--tag=quay.io/microcks/contract-testing-demo:02 .
docker buildx build --push \
--platform=linux/amd64,linux/arm64 \
--builder=buildx-multi-arch \
--provenance=false \
--build-arg TAG=03 \
--file Dockerfile-03 \
--tag=quay.io/microcks/contract-testing-demo:03 .
build-package-contract-testing-async:
runs-on: ubuntu-latest
environment: Build
steps:
# Checkout repository content
- name: Checkout
uses: actions/checkout@v3
- name: Filter contract-testing-async
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
contract-testing-async:
- 'contract-testing-demo-async/**'
- name: Set up QEMU
if: github.repository_owner == 'microcks' && steps.changes.outputs.contract-testing-async == 'true'
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: github.repository_owner == 'microcks' && steps.changes.outputs.contract-testing-async == 'true'
uses: docker/setup-buildx-action@v2
- name: Login to Quay.io Registry and setup multi-arch builder
if: github.repository_owner == 'microcks' && steps.changes.outputs.contract-testing-async == 'true'
run: |
echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USERNAME }} --password-stdin quay.io
BUILDER=buildx-multi-arch
docker buildx inspect $BUILDER || docker buildx create --name=$BUILDER --driver=docker-container --driver-opt=network=host
- name: Build and push container image
if: github.repository_owner == 'microcks' && steps.changes.outputs.contract-testing-async == 'true'
run: |
cd contract-testing-demo-async
docker buildx build --push \
--platform=linux/amd64,linux/arm64 \
--builder=buildx-multi-arch \
--provenance=false \
--build-arg TAG=01 \
--file Dockerfile-01 \
--tag=quay.io/microcks/contract-testing-demo-async:01 .
docker buildx build --push \
--platform=linux/amd64,linux/arm64 \
--builder=buildx-multi-arch \
--provenance=false \
--build-arg TAG=02 \
--file Dockerfile-02 \
--tag=quay.io/microcks/contract-testing-demo-async:02 .
build-package-shift-left-demo-sb:
runs-on: ubuntu-latest
environment: Build
steps:
# Checkout repository content
- name: Checkout
uses: actions/checkout@v3
- name: Filter shift-left-demo-sb
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
shift-left-demo-sb:
- 'shift-left-demo/spring-boot-order-service-devtools/**'
- name: Set up JDK 17 for x64
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
architecture: x64
cache: maven
- name: Build Java components
run: |
cd shift-left-demo/spring-boot-order-service-devtools
mvn -B clean package