-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (70 loc) · 2.37 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
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
78
79
80
81
name: Continuous integration
on:
push:
paths-ignore:
- "CHANGELOG.adoc"
- "README.adoc"
- "doc/**"
branches:
- "**"
tags:
- "*"
pull_request:
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Checkout
uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
fetch-depth: 0
- name: Checkout
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Java SDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
- name: Setup some global environment variables
run: |
echo "git_describe=$(git describe)" >> $GITHUB_ENV
echo "app_version_latest=$(grep version frontend/package.json | awk -F \" '{print $4}')" >> $GITHUB_ENV
- name: Build the frontend packages
run: |
echo "//npm.pkg.github.com/:_authToken=${{ github.token }}" >> .npmrc
echo "CI=true" >> $GITHUB_ENV
npm ci
npm run build
working-directory: frontend
- name: Copy frontend artifacts
run: |
mkdir -p backend/deeplab-frontend/src/main/resources/static
cp -R frontend/deeplab-web/dist/* backend/deeplab-frontend/src/main/resources/static
- name: Build the backend
env:
USERNAME: ${{ github.actor }}
PASSWORD: ${{ github.token }}
run: mvn -U -B -e clean verify -f backend/pom.xml --settings settings.xml
- name: Publish the backend
if: startsWith(github.ref, 'refs/tags/v')
env:
USERNAME: ${{ github.actor }}
PASSWORD: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
run: mvn -B deploy -DskipTests -f backend/pom.xml --settings settings.xml
- name: Store the fat jar
uses: actions/upload-artifact@v4
with:
name: application fat jar
path: backend/deeplab-application/target/deeplab-application-${{ env.app_version_latest }}.jar