-
Notifications
You must be signed in to change notification settings - Fork 236
115 lines (111 loc) · 3.71 KB
/
publish-release.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
name: Build and push WildFly Docker images
# This action requires 4 secrets:
# secrets.REGISTRY - the container registry (e.g. quay.io)
# secrets.IMAGE - the namespaced name of the image (e.g. wildfly/wildfly)
# secrets.REGISTRY_USER - the user name to authentication before pushing the image
# secrets.REGISTRY_PASSWORD - the user password to authentication before pushing the image
on:
push:
branches:
- "main"
tags:
- "*"
pull_request:
branches:
- "main"
jobs:
test:
# Only build linux/amd64 images for testing
env:
IMAGE_TEST: wildfly-test:latest
strategy:
matrix:
include:
- jdk-version: 11
dist: ubi9-minimal
platforms: linux/amd64
- jdk-version: 17
dist: ubi9-minimal
platforms: linux/amd64
- jdk-version: 21
dist: ubi9-minimal
platforms: linux/amd64
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/[email protected]
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Build WildFly images
id: docker_build
uses: docker/[email protected]
with:
load: true
tags: ${{ env.IMAGE_TEST }}
build-args: |
jdk=${{ matrix.jdk-version }}
dist=${{ matrix.dist }}
- name: Smoke Test
run: |
./scripts/smoke-test.sh ${{ env.IMAGE_TEST }}
# Push to the container registry only when a new tag is pushed
push:
needs: test
environment: quay.io
if: startsWith(github.event.ref, 'refs/tags/')
env:
# Put the "latest" tag on this JDK version
JDK_VERSION_FOR_LATEST: 21
strategy:
matrix:
include:
- jdk-version: 11
dist: ubi9-minimal
platforms: linux/amd64,linux/arm64,linux/ppc64le
- jdk-version: 17
dist: ubi9-minimal
platforms: linux/amd64,linux/arm64,linux/ppc64le
- jdk-version: 21
dist: ubi9-minimal
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/[email protected]
- name: Docker meta
id: meta
uses: docker/[email protected]
with:
images: ${{ secrets.REGISTRY }}/${{ secrets.IMAGE }}
flavor: |
latest=false
tags: |
type=ref,event=tag,suffix=-jdk${{ matrix.jdk-version }}
type=raw,value=latest,suffix=-jdk${{ matrix.jdk-version }}
type=raw,value=latest,enable=${{ matrix.jdk-version == env.JDK_VERSION_FOR_LATEST }}
labels: |
org.opencontainers.image.jdk-version=${{ matrix.jdk-version }}
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Docker Login to Quay.io
if: startsWith(github.event.ref, 'refs/tags/')
uses: docker/[email protected]
with:
registry: ${{ secrets.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Push WildFly images to container registry
id: docker_push
uses: docker/[email protected]
with:
push: true
platforms: ${{ matrix.platforms }}
build-args: |
jdk=${{ matrix.jdk-version }}
dist=${{ matrix.dist }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}