-
Notifications
You must be signed in to change notification settings - Fork 6
163 lines (150 loc) · 5.19 KB
/
docker-publish.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Docker
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
schedule:
# run every Wednesday
- cron: '31 23 * * 2'
push:
branches:
- main
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
IMAGE_NAME: peterstadler/existdb
jobs:
build:
name: build the Docker images
runs-on: ubuntu-latest
strategy:
matrix:
include:
- IMAGE_TAG: |
6
6.3
6.3.0
6-jre17
6.3-jre17
6.3.0-jre17
latest
EXIST_VERSION: "6.3.0"
EXIST_URL: https://github.com/eXist-db/exist/releases/download/eXist-6.3.0/exist-installer-6.3.0.jar
SAXON_JAR: /opt/exist/lib/Saxon-HE-9.9.1-8.jar
BASE_IMAGE: eclipse-temurin:17-jre
- IMAGE_TAG: |
6-jre11
6.3-jre11
6.3.0-jre11
EXIST_VERSION: "6.3.0"
EXIST_URL: https://github.com/eXist-db/exist/releases/download/eXist-6.3.0/exist-installer-6.3.0.jar
SAXON_JAR: /opt/exist/lib/Saxon-HE-9.9.1-8.jar
BASE_IMAGE: eclipse-temurin:11-jre
- IMAGE_TAG: |
6.2
6.2.0
6.2-jre17
6.2.0-jre17
EXIST_VERSION: "6.2.0"
EXIST_URL: https://github.com/eXist-db/exist/releases/download/eXist-6.2.0/exist-installer-6.2.0.jar
SAXON_JAR: /opt/exist/lib/Saxon-HE-9.9.1-8.jar
BASE_IMAGE: eclipse-temurin:17-jre
- IMAGE_TAG: |
6.2-jre11
6.2.0-jre11
EXIST_VERSION: "6.2.0"
EXIST_URL: https://github.com/eXist-db/exist/releases/download/eXist-6.2.0/exist-installer-6.2.0.jar
SAXON_JAR: /opt/exist/lib/Saxon-HE-9.9.1-8.jar
BASE_IMAGE: eclipse-temurin:11-jre
- IMAGE_TAG: |
5
5.5
5.5.2
5-jre8
5.5-jre8
5.5.2-jre8
EXIST_VERSION: "5.5.2"
EXIST_URL: https://github.com/eXist-db/exist/releases/download/eXist-5.5.2/exist-installer-5.5.2.jar
SAXON_JAR: /opt/exist/lib/Saxon-HE-9.9.1-8.jar
BASE_IMAGE: eclipse-temurin:8-jre
- IMAGE_TAG: |
4
4.11
4.11.2
4-jre8
4.11-jre8
4.11.2-jre8
EXIST_VERSION: "4.11.2"
EXIST_URL: https://github.com/eXist-db/exist/releases/download/eXist-4.11.2/eXist-db-setup-4.11.2.jar
SAXON_JAR: /opt/exist/lib/endorsed/Saxon-HE-9.6.0-7.jar
BASE_IMAGE: eclipse-temurin:8-jre
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PETERS_GITHUB_TOKEN }}
# Login against DockerHub registry except on PR
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.PETERS_DOCKERHUB_USERNAME }}
password: ${{ secrets.PETERS_DOCKERHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
${{ secrets.PETERS_DOCKERHUB_USERNAME }}/existdb
tags: ${{ matrix.IMAGE_TAG }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
build-args: |
VERSION=${{ matrix.EXIST_VERSION }}
EXIST_URL=${{ matrix.EXIST_URL }}
SAXON_JAR=${{ matrix.SAXON_JAR }}
BASE_IMAGE=${{ matrix.BASE_IMAGE }}
push: ${{ github.event_name != 'pull_request' }}
platforms: |
linux/amd64
linux/arm64/v8
linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
clean:
name: remove untagged images from Github package registry
needs: build
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- name: ghcr.io cleanup action
uses: dataaxiom/ghcr-cleanup-action@v1
with:
package: existdb
delete-untagged: true
dry-run: false
validate: true
older-than: 2 weeks
token: ${{ secrets.GITHUB_TOKEN }}