-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (87 loc) · 2.84 KB
/
github.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: test and docker
on:
push:
branches:
- master
jobs:
# Build and test the applications with multiple Java versions
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [
'11.0.x',
'16.0.x',
'17.0.x',
'18.0.x',
]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: JDK Set up
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
architecture: x64
distribution: 'temurin'
cache: 'maven'
- name: Package privacydashboard
run: mvn clean package -Pproduction
- name: Coverage Report
run: mvn jacoco:report
- name: Generate Jacoco Badge
id: jacoco
if: ${{ matrix.java-version == '18.0.x' }}
uses: cicirello/jacoco-badge-generator@v2
with:
jacoco-csv-file: target/site/jacoco/jacoco.csv
- name: Log coverage percentage
if: ${{ matrix.java-version == '18.0.x' }}
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
- name: Move the badge to jacoco-aggregate folder
if: ${{ matrix.java-version == '18.0.x' }}
run: |
mv .github/badges/*.svg target/site/jacoco/
- name: Deploy Jacoco code coverage reports to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ matrix.java-version == '18.0.x' }}
with:
clean: true
folder: target/site/jacoco
target-folder: reports
branch: gh-pages
# Build files necessary for building Docker Images (Dockerfiles and Contexts)
build-for-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: "18.0.x"
architecture: x64
distribution: 'temurin'
cache: 'maven'
# Build multiarch Docker Images and push as GitHub Packages
docker-image-push:
if: ${{ github.repository == 'sifis-home/privacydashboard' }}
needs: [build-and-test, build-for-docker]
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub container registry (ghcr.io)
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v4
with:
platforms: linux/amd64, linux/arm64
push: true
tags: ghcr.io/sifis-home/privacydashboard:latest
outputs: type=registry, annotation-index.org.opencontainers.image.description=PrivacyDashboard