forked from ehrbase/ehrbase
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (59 loc) · 1.77 KB
/
build.yaml
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
name: build
on:
push:
branches:
- num-main
- 'feature/**'
- 'feat/**'
- 'fix/**'
paths-ignore:
- '.circleci/**'
- '.docker_scripts/**'
- 'doc/**'
- 'tests/**'
- '**/*.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Set some variables for the build
run: |
if [ ${{ github.ref }} != 'refs/heads/num-main' ]; then
echo "IS NOT num-main branch"
echo "BUILD_VERSION=0.32.x-num-$GITHUB_RUN_NUMBER-PR" >> $GITHUB_ENV
else
echo "IS main branch"
echo "BUILD_VERSION=0.32.x-num-$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
fi
shell: bash
- name: See some values
run: |
echo "GITHUB_REF=$GITHUB_REF"
echo "GITHUB_REF_NAME=$GITHUB_REF_NAME"
echo "GITHUB_RUN_NUMBER=$GITHUB_RUN_NUMBER"
echo "GITHUB_RUN_ID=$GITHUB_RUN_ID"
echo "BUILD_VERSION=$BUILD_VERSION"
- name: Echo Env Vars through Context
run: |
echo "$GITHUB_CONTEXT"
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set Build-Version in pom.xml
run: ./mvnw versions:set -DnewVersion=$BUILD_VERSION
- name: Build with Maven
run: ./mvnw verify
- name: Docker push image
run: ./mvnw -pl build-docker-image io.fabric8:docker-maven-plugin:0.40.2:push