-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.24 KB
/
build.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
name: Build
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: adopt
architecture: x64
cache: maven
server-id: philterd-repository-snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Build
run: mvn --batch-mode --update-snapshots test
env:
MAVEN_USERNAME: ${{ secrets.PHILTERD_ARTIFACTS_USER }}
MAVEN_PASSWORD: ${{ secrets.PHILTERD_ARTIFACTS_TOKEN }}
- name: Deploy
if: ${{ github.ref == 'refs/heads/main' }}
run: mvn --batch-mode --update-snapshots package deploy
env:
MAVEN_USERNAME: ${{ secrets.PHILTERD_ARTIFACTS_USER }}
MAVEN_PASSWORD: ${{ secrets.PHILTERD_ARTIFACTS_TOKEN }}