-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (46 loc) · 1.33 KB
/
ci.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
name: CI Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
runs-on: ubuntu-latest
env:
TZ: Europe/Oslo
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: maven
- name: Run tests
run: |
sudo timedatectl set-timezone "Europe/Oslo"
mvn --batch-mode test
image:
# only build and push the image when it's a commit to master in Entur's repository
if: github.repository_owner == 'entur' && github.event_name == 'push'
runs-on: ubuntu-latest
needs: [ tests ]
env:
CONTAINER_REPO: docker.io/entur/tiamat
CONTAINER_REGISTRY_USER: ${{ secrets.DOCKERHUB_LOGIN }}
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: maven
- name: Build container image with Jib, push to container repo
run: |
image_date=`date +%Y-%m-%dT%H-%M`
mvn --batch-mode compile com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_date