forked from georchestra/georchestra
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 2.95 KB
/
geowebcache.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
name: "geowebcache"
on:
workflow_dispatch:
push:
paths:
- "commons/**"
- "geowebcache-webapp/**"
pull_request:
paths:
- "commons/**"
- "geowebcache-webapp/**"
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@v2
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
- name: "Installing & checking formatting"
run: ./mvnw --no-transfer-progress -B -P-all,geowebcache -Dfmt.action=validate install -Dadditionalparam=-Xdoclint:none -DskipTests
- name: "Running tests"
working-directory: geowebcache-webapp/
run: ../mvnw --no-transfer-progress clean verify -Pit -Dfmt.skip=true -Dadditionalparam=-Xdoclint:none
- name: Getting image tag
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: "Building docker image"
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
working-directory: geowebcache-webapp/
run: ../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/geowebcache:${{ steps.version.outputs.VERSION }} -DskipTests
- name: "Logging in docker.io"
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
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' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker tag georchestra/geowebcache:${{ steps.version.outputs.VERSION }} georchestra/geowebcache:latest
docker push georchestra/geowebcache:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/geowebcache:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker push georchestra/geowebcache:${{ steps.version.outputs.VERSION }}
- name: "Remove SNAPSHOT jars from repository"
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}