-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (84 loc) · 2.85 KB
/
push-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
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
name: push-docker
# IMAGE_NAME_1: string; The name of the first image.
# 'indexdata/harvester'
#
# IMAGE_NAME_2: string; The name of the second image.
# 'indexdata/harvester-admin'
env:
CONTAINER_REGISTRY: 'ghcr.io'
IMAGE_NAME_1: 'indexdata/harvester'
IMAGE_NAME_2: 'indexdata/harvester-admin'
on:
schedule:
- cron: '15 01 * * 6'
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # i.e. release tag only
workflow_dispatch:
jobs:
push-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Create Maven settings
uses: s4u/[email protected]
with:
mirrors: |
[
{
"id": "maven-restlet-https",
"name": "maven-restlet via https",
"mirrorOf": "maven-restlet",
"url": "https://maven.restlet.talend.com"
}
]
- name: Do Maven build harvester
run: mvn verify
- name: Log into GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ github.ACTOR }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract docker metadata for harvester
id: meta-1
uses: docker/metadata-action@v4
with:
images: ${{ env.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME_1 }}
labels: |
org.opencontainers.image.title=Harvester
org.opencontainers.image.description=Harvester server
org.opencontainers.image.vendor=Index Data LLC
org.opencontainers.image.documentation=https://github.com/indexdata/localindices/tree/master/doc
- name: Extract docker metadata for harvester-admin
id: meta-2
uses: docker/metadata-action@v4
with:
images: ${{ env.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME_2 }}
labels: |
org.opencontainers.image.title=Harvester Admin
org.opencontainers.image.description=Harvester administrative user interface
org.opencontainers.image.vendor=Index Data LLC
- name: Build and publish Docker for harvester
uses: docker/build-push-action@v4
with:
context: .
push: true
target: harvester
tags: ${{ steps.meta-1.outputs.tags }}
labels: ${{ steps.meta-1.outputs.labels }}
- name: Build and publish Docker for harvester-admin
uses: docker/build-push-action@v4
with:
context: .
push: true
target: harvester-admin
tags: ${{ steps.meta-2.outputs.tags }}
labels: ${{ steps.meta-2.outputs.labels }}