forked from microcks/microcks
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (73 loc) · 2.69 KB
/
build-verify.yml
File metadata and controls
83 lines (73 loc) · 2.69 KB
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
name: build-verify-package
on:
push:
paths-ignore:
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'README*'
pull_request:
paths-ignore:
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'README*'
jobs:
build-verify-package:
runs-on: ubuntu-latest
environment: Build
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up JDK 11 for x64
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
architecture: x64
cache: maven
- name: Build Java components
run: mvn -B clean install
- name: Build Angular app
run: |
cd ${{github.workspace}}/webapp
mvn -B -Pprod -DskipTests package
- name: Run Integration tests
run: |
cd ${{github.workspace}}/webapp
mvn -Pit test
- name: Verify Javadoc completion
run: mvn -B javadoc:javadoc
- name: Set environment for branch
run: |
set -x
if [[ $GITHUB_REF == 'refs/heads/master' ]]; then
echo "IMAGE_TAG=latest" >> "$GITHUB_ENV"
echo "PACKAGE_IMAGE=true" >> "$GITHUB_ENV"
elif [[ $GITHUB_REF == 'refs/heads/1.6.x' ]]; then
echo "IMAGE_TAG=nightly" >> "$GITHUB_ENV"
echo "PACKAGE_IMAGE=true" >> "$GITHUB_ENV"
elif [[ $GITHUB_REF == "refs/tags/$GITHUB_REF_NAME" ]]; then
echo "IMAGE_TAG=$GITHUB_REF_NAME" >> "$GITHUB_ENV"
echo "PACKAGE_IMAGE=true" >> "$GITHUB_ENV"
else
echo "PACKAGE_IMAGE=false" >> "$GITHUB_ENV"
fi
- name: Package container image for webapp
if: github.repository_owner == 'microcks' && env.PACKAGE_IMAGE == 'true'
run: |
cd ${{github.workspace}}/webapp
mvn -B -q -Pprod -DskipTests package docker:build;
docker tag microcks/microcks quay.io/microcks/microcks:$IMAGE_TAG
- name: Package container image for async minion
if: github.repository_owner == 'microcks' && env.PACKAGE_IMAGE == 'true'
run: |
cd ${{github.workspace}}/minions/async
mvn -B -q -DskipTests package
docker build -f src/main/docker/Dockerfile.jvm -t quay.io/microcks/microcks-async-minion:$IMAGE_TAG .
- name: Login and push to Quay.io Registry
if: github.repository_owner == 'microcks' && env.PACKAGE_IMAGE == 'true'
run: |
echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USERNAME }} --password-stdin quay.io
docker push quay.io/microcks/microcks:$IMAGE_TAG
docker push quay.io/microcks/microcks-async-minion:$IMAGE_TAG