forked from georchestra/georchestra
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (67 loc) · 2.75 KB
/
analytics.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
name: "analytics"
on:
push:
paths:
- "commons/**"
- "analytics/**"
pull_request:
paths:
- "commons/**"
- "analytics/**"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "Checking out"
uses: actions/checkout@v1
- name: "Setting up Java"
uses: actions/setup-java@v1
with:
java-version: '8.x'
- name: "Configuring Maven"
run: |
mkdir -p $HOME/.m2
cp .github/resources/m2-settings.xml $HOME/.m2/settings.xml
- name: "Maven repository caching"
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Installing & checking formatting"
run: ./mvnw --no-transfer-progress -B -P-all,analytics -Dfmt.action=validate install -Dadditionalparam=-Xdoclint:none -DskipTests
- name: "Running tests"
working-directory: analytics/
run: ../mvnw --no-transfer-progress clean verify -Pit -Dfmt.skip=true -Dadditionalparam=-Xdoclint:none
- name: Getting image tag
if: github.repository == 'georchestra/georchestra'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: "Building docker image"
if: github.repository == 'georchestra/georchestra'
working-directory: analytics/
run: ../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/analytics:${{ steps.version.outputs.VERSION }} -DskipTests
- name: "Logging in docker.io"
if: github.repository == 'georchestra/georchestra'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'
- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra'
run: |
docker tag georchestra/analytics:${{ steps.version.outputs.VERSION }} georchestra/analytics:latest
docker push georchestra/analytics:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/20.') && github.repository == 'georchestra/georchestra'
run: |
docker push georchestra/analytics:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/20.') && github.repository == 'georchestra/georchestra'
run: |
docker push georchestra/analytics:${{ steps.version.outputs.VERSION }}
- name: "Remove SNAPSHOT jars from repository"
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}