-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.16 KB
/
maven.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
name: Java CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
- name: Cache Maven Dependencies (~/.m2/repository)
uses: actions/[email protected]
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-:
- name: Setup Maven settings.xml
uses: whelk-io/maven-settings-xml-action@v21
with:
servers: '[{ "id": "nexus_deployment", "username": "${env.NEXUS_DEPLOYMENT_USER}", "password": "${env.NEXUS_DEPLOYMENT_PASS}" }]'
- name: Build Packages
run: ./mvnw -ntp clean verify
if: github.ref != 'refs/heads/main'
- name: Build and Deploy Packages
run: ./mvnw -ntp clean deploy
if: github.ref == 'refs/heads/main'
env:
NEXUS_DEPLOYMENT_USER: ${{ secrets.NEXUS_DEPLOYMENT_USER }}
NEXUS_DEPLOYMENT_PASS: ${{ secrets.NEXUS_DEPLOYMENT_PASS }}