-
Notifications
You must be signed in to change notification settings - Fork 25
115 lines (108 loc) · 3.83 KB
/
ci-build-and-push.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
name: Java CI Maven Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Maven
# Usually the build would run 'verify' but this runs the long-winded integration tests, so we run 'test' here only:
run: |
export JAVA_OPTS="-Xmx2048m"
export MAVEN_CLI_OPTS="--no-transfer-progress"
mvn --batch-mode test
push_to_docker_hub:
needs: build
name: Push Docker image to Docker Hub
# This uses the default metadata-action configuration, see https://github.com/docker/metadata-action
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ github.repository }}
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push to Docker Hub
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push_solr_to_docker_hub:
needs: build
name: Push Solr Docker image to Docker Hub
# This uses the default metadata-action configuration, see https://github.com/docker/metadata-action
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
# Use different container name:
images: ukwa/webarchive-discovery-solr
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push to Docker Hub
uses: docker/build-push-action@v2
with:
# Use different build context:
context: ./warc-indexer/src/main/solr
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push_solr9_to_docker_hub:
needs: build
name: Push Solr 9 Docker image to Docker Hub
# This uses the default metadata-action configuration, see https://github.com/docker/metadata-action
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
# Use different container name:
images: ukwa/webarchive-discovery-solr
flavor: |
latest=auto
prefix=
suffix=-solr9
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push to Docker Hub
uses: docker/build-push-action@v2
with:
# Use different build context:
context: ./warc-indexer/src/main/solr
file: ./warc-indexer/src/main/solr/Dockerfile9
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}