-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (40 loc) · 1.66 KB
/
image-push.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
name: Narayana LRA Coordinator quay.io image push
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'pom.xml'
jobs:
build:
runs-on: ubuntu-latest
name: Push image to quay.io
if: ${{ contains(github.event.head_commit.message, 'narayana-bom') || contains(github.event.head_commit.message, 'quarkus.platform.version') || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Check changed files
id: check_upgrades
run: |
set +e
git diff -U0 HEAD^ HEAD | grep "<quarkus.platform.version>\|<narayana.version>"
export narayana_or_quarkus_upgrade=$(echo $?)
set -e
echo "::set-output name=NARAYANA_OR_QUARKUS_UPGRADE::$narayana_or_quarkus_upgrade"
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 17
distribution: temurin
cache: maven
check-latest: true
- name: Build, Test and push image
if: ${{ steps.check_upgrades.outputs.NARAYANA_OR_QUARKUS_UPGRADE == '0' || github.event_name == 'workflow_dispatch' }}
run: |
./mvnw clean package -Dquarkus.container-image.build=true -Dquarkus.container-image.push=true \
-Dquarkus.container-image.tag=$(./mvnw help:evaluate -Dexpression=narayana.version -q -DforceStdout)-$(./mvnw help:evaluate -Dexpression=quarkus.platform.version -q -DforceStdout)
env:
QUARKUS_CONTAINER_IMAGE_USERNAME: ${{ secrets.QUARKUS_CONTAINER_IMAGE_USERNAME }}
QUARKUS_CONTAINER_IMAGE_PASSWORD: ${{ secrets.QUARKUS_CONTAINER_IMAGE_PASSWORD }}