-
-
Notifications
You must be signed in to change notification settings - Fork 7
51 lines (39 loc) · 1.05 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
name: build
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
IMAGE_NAME: tp2intervals
jobs:
get-version:
uses: .github/workflows/get-version.yml
build:
runs-on: ubuntu-latest
steps:
- env:
version: ${{needs.get-version.outputs.version}}
run: echo "current version is $version"
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'corretto'
cache: 'gradle'
- uses: actions/setup-node@v4
with:
node-version: 20.10.0
- name: Build backend
working-directory: ./boot
run: ./gradlew build
- name: Build frontend
working-directory: ./ui
run: npm ci && npm run build
- name: Build image
env:
VERSION: ${{needs.get-version.outputs.version}}
run: docker build . --file Dockerfile --tag $IMAGE_NAME --build-arg JAR_NAME=$JAR_NAME-$VERSION.jar