Skip to content

ci

ci #229

Workflow file for this run

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