-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (48 loc) · 1.67 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
name: Build
on:
pull_request:
branches:
- main
paths-ignore:
- '**.md'
push:
branches:
- main
paths-ignore:
- '**.md'
jobs:
build:
if: github.repository_owner == 'hawtio'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: ['17', '21']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Build
run: |
mvn --batch-mode --no-transfer-progress install -Djkube.build.strategy=docker
- name: Push image to Quay.io
if: github.event_name == 'push'
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
run: |
docker login --help
docker login -u $USERNAME -p $PASSWORD quay.io
docker tag quay.io/hawtio/hawtio-online-example-camel-quarkus:latest quay.io/hawtio/hawtio-online-example-camel-quarkus:${{matrix.java}}
docker tag quay.io/hawtio/hawtio-online-example-camel-springboot:latest quay.io/hawtio/hawtio-online-example-camel-springboot:${{matrix.java}}
docker push quay.io/hawtio/hawtio-online-example-camel-quarkus:${{matrix.java}}
docker push quay.io/hawtio/hawtio-online-example-camel-springboot:${{matrix.java}}
if [[ "${{matrix.java}}" == "21" ]]; then
docker push quay.io/hawtio/hawtio-online-example-camel-quarkus:latest
docker push quay.io/hawtio/hawtio-online-example-camel-springboot:latest
fi