This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
136 lines (105 loc) · 3.63 KB
/
ci.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Build, Test and Deploy Maven Package and Docker Image
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
push:
branches:
- master
tags:
- v[0-9]+.[0-9]+**
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Cache Local Maven Repo
uses: actions/[email protected]
with:
path: ~/.m2/repository
key: maven-repo
- name: Start FHIR test server
run: docker-compose -f docker-compose-test.yml up -d
- name: Wait for FHIR Server Running
uses: ifaxity/wait-on-action@v1
with:
resource: http-get://localhost:8080/fhir/CapabilityStatement
timeout: 60000
- name: Initialize FHIR test data
run: bash ./init-testdata.sh
- name: Build
run: mvn -B package
deploy-maven-package:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set Up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Cache Local Maven Repo
uses: actions/[email protected]
with:
path: ~/.m2/repository
key: maven-repo
- name: Add GitHub Server Credentials to Maven settings.xml
uses: s4u/[email protected]
- name: Prepare Version
id: prep
run: |
echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
- name: Set Version in Maven Parent Project and Submodules
run: mvn -q versions:set -DnewVersion="${{ steps.prep.outputs.version }}" -DprocessAllModules=true
- name: Build and Deploy Maven Packages
run: mvn deploy -DskipTests
deploy-docker-image:
needs: deploy-maven-package
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set Up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Cache Local Maven Repo
uses: actions/[email protected]
with:
path: ~/.m2/repository
key: maven-repo
- name: Prepare Version
id: prep
run: |
echo ::set-output name=repository::$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')
echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
- name: Set Version in Maven Parent Project and Submodules
run: mvn -q versions:set -DnewVersion="${{ steps.prep.outputs.version }}" -DprocessAllModules=true
- name: Set Version in Server Project
run: mvn -q -f ./server/pom.xml versions:set -DnewVersion="${{ steps.prep.outputs.version }}"
- name: Update Server Dependencies Version
run: mvn -q -f ./server/pom.xml versions:use-dep-version -Dincludes="de.rwth.imi.flare" -DdepVersion="${{ steps.prep.outputs.version }}"
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
file: ./server/Dockerfile
build-args: |
mavenOptions="-q"
push: true
tags: |
ghcr.io/${{ steps.prep.outputs.repository }}:latest
ghcr.io/${{ steps.prep.outputs.repository }}:${{ steps.prep.outputs.version }}