-
Notifications
You must be signed in to change notification settings - Fork 9
97 lines (88 loc) · 3.04 KB
/
build.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
name: Build
# Controls when the workflow will run
on:
workflow_dispatch:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
# permissions are needed if pushing to ghcr.io
permissions:
packages: write
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/[email protected]
with:
distribution: 'corretto'
java-version: 21
cache: "maven"
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Install services
run: |
sh create-microservices.sh
sh mvnw -B -U clean install
- name: Build and push Command service
uses: docker/build-push-action@v2
with:
context: microservices/rental-command
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/axoniq/bike-rental-command:latest
- name: Build and push Rental Payment service
uses: docker/build-push-action@v2
with:
context: microservices/rental-payment
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/axoniq/bike-rental-rental-payment:latest
- name: Build and push Payment service
uses: docker/build-push-action@v2
with:
context: payment
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/axoniq/bike-rental-payment:latest
- name: Build and push Query service
uses: docker/build-push-action@v2
with:
context: microservices/rental-query
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/axoniq/bike-rental-query:latest
- name: Build and push UI service
uses: docker/build-push-action@v2
with:
context: microservices/rental-ui
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/axoniq/bike-rental-ui:latest
- name: Build and push axon server
uses: docker/build-push-action@v2
with:
context: .github/axonserver
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/axoniq/bike-rental-axonserver-control-tower:latest