-
Notifications
You must be signed in to change notification settings - Fork 4
77 lines (73 loc) · 2.71 KB
/
ci.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
name: ci
on:
push:
branches: [master]
paths:
- ".github/workflows/ci.yml"
- "src/**"
- "pom.xml"
pull_request:
branches: [master]
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: "15 1 * * 1"
permissions:
packages: write
concurrency:
group: ci
cancel-in-progress: false
jobs:
build-jvm:
runs-on: ubuntu-latest
env:
MVN: mvn --show-version --batch-mode
steps:
- name: jdk17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "adopt"
- name: login registry.redhat.io
uses: redhat-actions/podman-login@v1
with:
registry: registry.redhat.io
username: ${{ secrets.REDHAT_USR }}
password: ${{ secrets.REDHAT_PWD }}
- name: checkout
uses: actions/checkout@v3
- name: cache ~/.m2
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: mvn clean compile
run: $MVN clean compile
- name: mvn test
run: $MVN test
- name: mvn package -DskipTests -Dquarkus.container-image.push=true latest
if: github.ref == 'refs/heads/master'
run: >-
$MVN package -DskipTests
-Dquarkus.container-image.push=true
-Dquarkus.container-image.username=${{ github.actor }}
-Dquarkus.container-image.password=${{ secrets.GITHUB_TOKEN }}
-Dquarkus.container-image.image=ghcr.io/${{ github.repository }}:latest
'-Dquarkus.container-image.labels."org.opencontainers.image.revision"='$GITHUB_SHA
- name: mvn package -DskipTests -Dquarkus.container-image.push=true snapshot
if: github.ref != 'refs/heads/master'
run: >-
$MVN package -DskipTests
-Dquarkus.container-image.push=true
-Dquarkus.container-image.username=${{ github.actor }}
-Dquarkus.container-image.password=${{ secrets.GITHUB_TOKEN }}
-Dquarkus.container-image.image=ghcr.io/${{ github.repository }}:snapshot
'-Dquarkus.container-image.labels."org.opencontainers.image.revision"='$GITHUB_SHA