-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (38 loc) · 1.11 KB
/
maven-publish.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
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}
- name: Build with Maven
run: |
if [ "${{ github.ref_name }}" == "master" ]; then
mvn -B package --file backend/pom.xml
elif [ "${{ github.ref_name }}" == "localhost" ]; then
mvn -B package --file local_backend/pom.xml
fi
- name: Publish to GitHub Packages Apache Maven
run: |
if [ "${{ github.ref_name }}" == "master" ]; then
mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file backend/pom.xml
elif [ "${{ github.ref_name }}" == "localhost" ]; then
mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file local_backend/pom.xml
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}