-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (59 loc) · 1.83 KB
/
master.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
# cf. https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Master Build
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
quarkusMode: [jvm, native]
include:
- quarkusMode: native
dockerImageTag: native
mvnNativeArg: -Pnative
- quarkusMode: jvm
dockerImageTag: latest
mvnNativeArg: -P!native
steps:
# setup
- name: Set up JDK 11
if: ${{ matrix.quarkusMode == 'jvm' }}
uses: actions/setup-java@v1
with:
java-version: 11
java-package: jdk
- name: Set up GraalVM
if: ${{ matrix.quarkusMode == 'native' }}
uses: rinx/[email protected]
with:
graalvm-version: "20.1.0"
java-version: "java11"
native-image: "true"
- uses: actions/checkout@v2
# Maven
- name: Build with Maven
run: mvn -B package --file pom.xml ${{ matrix.mvnNativeArg }}
- name: Archive JAR files
uses: actions/upload-artifact@v2
with:
name: jar-${{ matrix.quarkusMode }}
path: target/*.jar
- name: Archive Surefire reports
uses: actions/upload-artifact@v2
with:
name: surefire-reports-${{ matrix.quarkusMode }}
path: target/surefire-reports/*.xml
# Docker
# cf. https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build Docker image
uses: docker/build-push-action@v1
with:
dockerfile: src/main/docker/Dockerfile.${{ matrix.quarkusMode }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: fxnn/artixray
tags: ${{ matrix.dockerImageTag }}
add_git_labels: true