-
Notifications
You must be signed in to change notification settings - Fork 5
68 lines (56 loc) · 1.69 KB
/
main.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
name: Build Kafka Test Apps
on:
push:
branches: [ "main" ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_ORG: ${{ github.actor }}
DOCKER_TAG: latest
steps:
# Checkout sources
- uses: actions/checkout@v3
# Install Java
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
# Setup Maven cache
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Setup QEMU for multiplatform Docker builds
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# Setup Docker credentials
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build the Java project
- name: Build the Java project
run: make build
# Build the Container images
- name: Build and push the containers for amd64
run: make docker_build docker_push docker_amend_manifest
env:
DOCKER_ARCHITECTURE: amd64
- name: Build and push the containers for arm64
run: make docker_build docker_push docker_amend_manifest
env:
DOCKER_ARCHITECTURE: arm64
# Push the container manifest
- name: Push the container manifest
run: make docker_push_manifest