-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (48 loc) · 1.65 KB
/
docker.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
name: "Build and publish docker image"
on:
workflow_dispatch:
push:
branches:
- main
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: "Checking out"
uses: actions/checkout@v3
with:
submodules: 'true'
- name: "Setting up Java"
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
cache: 'maven'
- name: "Build georchestra dependencies"
run: make deps
- name: "Build gateway"
run: make install test
- name: "Resolve docker image tag"
id: version
run: echo ::set-output name=VERSION::$(./mvnw -f gateway/ help:evaluate -q -DforceStdout -Dexpression=imageTag)
- name: "Build docker image"
if: github.repository == 'georchestra/georchestra-gateway'
run: make docker
- name: "Log in to docker.io"
if: github.repository == 'georchestra/georchestra-gateway'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'
- name: "Push latest to docker.io"
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
run: docker push georchestra/gateway:latest
- name: "Push tagged image to docker.io"
if: github.ref != 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
run: docker push georchestra/gateway:${{ steps.version.outputs.VERSION }}
- name: "Remove SNAPSHOT jars from repository"
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}