-
Notifications
You must be signed in to change notification settings - Fork 6
89 lines (77 loc) · 3.06 KB
/
mvn-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
82
83
84
85
86
87
88
name: "CI - JDK 11 Build"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-jdk11:
name: "JDK 11 Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup AdoptOpenJDK
uses: joschi/setup-jdk@v2.3.0
with:
java-version: 11
- name: Build
run: ./mvnw clean package -X -Dquarkus.test.profile.tags=core
- name: Upload jar file created
uses: actions/upload-artifact@v2
with:
name: release-manager-jar-files
path: |
${{ github.workspace }}/target/quarkus-app/app
${{ github.workspace }}/target/quarkus-app/quarkus
${{ github.workspace }}/target/quarkus-app/lib
${{ github.workspace }}/target/quarkus-app/*.jar
if-no-files-found: error
build-container:
name: "Build container image"
needs: build-jdk11
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v2
- name: Upload jar file built
uses: actions/download-artifact@v2
with:
name: release-manager-jar-files
path: target/
- name: Display structure of directories and files
run: find . -type d
- name: Container meta
id: container_meta
uses: crazy-max/ghaction-docker-meta@v2
with:
# list of Docker images to use as base name for tags
images: |
quay.io/snowdrop/release-manager
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=ref,event=tag
# Enable by default to tag the image with latest
flavor: |
latest=true
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: Build and push
id: container_build
uses: docker/build-push-action@v2
with:
context: .
file: ./ci/Dockerfile.jvm
# tags: quay.io/snowdrop/release-manager:latest
push: true
tags: ${{ steps.container_meta.outputs.tags }}
labels: ${{ steps.container_meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.container_build.outputs.digest }}