-
Notifications
You must be signed in to change notification settings - Fork 17
63 lines (50 loc) · 1.41 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
name: Build
on:
push:
branches:
- main
release:
types:
- published
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
jdk: [8,11,17]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare version labels
uses: k15g/action-version-labels@edge
with:
prefix: project
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}
- name: Build with Maven
run: mvn -B --no-transfer-progress package
- name: Docker login
uses: docker/login-action@v1
if: matrix.jdk == 8
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build Docker image
run: make docker_build tag=dev
if: matrix.jdk == 8
- name: Push egde images
if: "matrix.jdk == 8 && !startsWith(github.ref, 'refs/tags/')"
run: make docker_push tag=edge
- name: Push images
if: "matrix.jdk == 8 && startsWith(github.ref, 'refs/tags/')"
run: |
make docker_push tag=${{ env.PROJECT_VERSION }}
make docker_push tag=latest