-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (136 loc) · 5.06 KB
/
build.yaml
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
name: Build
on:
workflow_dispatch: {}
push:
branches: [main]
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: maven
- run: echo "timestamp=`date +"%Y%m%d-%H%M%S"`" >> $GITHUB_ENV
- run: echo "version=`mvn help:evaluate -Dexpression=version.org.keycloak -DforceStdout -q`" >> $GITHUB_ENV
- run: echo "major=`mvn help:evaluate -Dexpression=version.org.keycloak -DforceStdout -q | cut -d. -f1`" >> $GITHUB_ENV
- run: mvn -B -ntp prepare-package -Dimage.tag=${{ env.version }}-${{ env.timestamp }}
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: docker/login-action docker.io
uses: docker/[email protected]
with:
registry: docker.io
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_TOKEN }}
- name: docker/login-action ghcr.io
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GIT_ACTION_TOKEN }}
- name: docker/metadata-action temurin
uses: docker/metadata-action@v4
id: temurin
with:
images: |
ghcr.io/kokuwaio/keycloak
docker.io/kokuwaio/keycloak
tags: |
latest
${{ env.timestamp }}
${{ env.version }}
${{ env.version }}-${{ env.timestamp }}
${{ env.major }}
${{ env.major }}-${{ env.timestamp }}
temurin
${{ env.timestamp }}-temurin
${{ env.version }}-temurin
${{ env.version }}-${{ env.timestamp }}-temurin
${{ env.major }}-temurin
${{ env.major }}-${{ env.timestamp }}-temurin
- name: docker/metadata-action temurin-import
uses: docker/metadata-action@v4
id: temurin-import
with:
images: |
ghcr.io/kokuwaio/keycloak
docker.io/kokuwaio/keycloak
tags: |
import
${{ env.timestamp }}-import
${{ env.version }}-import
${{ env.version }}-${{ env.timestamp }}-import
${{ env.major }}-import
${{ env.major }}-${{ env.timestamp }}-import
temurin-import
${{ env.timestamp }}-temurin-import
${{ env.version }}-temurin-import
${{ env.version }}-${{ env.timestamp }}-temurin-import
${{ env.major }}-temurin-import
${{ env.major }}-${{ env.timestamp }}-temurin-import
- name: docker/metadata-action distroless
uses: docker/metadata-action@v4
id: distroless
with:
images: |
ghcr.io/kokuwaio/keycloak
docker.io/kokuwaio/keycloak
tags: |
distroless
${{ env.timestamp }}-distroless
${{ env.version }}-distroless
${{ env.version }}-${{ env.timestamp }}-distroless
${{ env.major }}-distroless
${{ env.major }}-${{ env.timestamp }}-distroless
- name: docker/metadata-action distroless-import
uses: docker/metadata-action@v4
id: distroless-import
with:
images: |
ghcr.io/kokuwaio/keycloak
docker.io/kokuwaio/keycloak
tags: |
distroless-import
${{ env.timestamp }}-distroless-import
${{ env.version }}-distroless-import
${{ env.version }}-${{ env.timestamp }}-distroless-import
${{ env.major }}-distroless-import
${{ env.major }}-${{ env.timestamp }}-distroless-import
- name: docker/build-push-action base
uses: docker/build-push-action@v5
with:
context: target/docker/base
push: true
platforms: linux/amd64,linux/arm64
tags: docker.io/kokuwaio/keycloak:${{ env.version }}-${{ env.timestamp }}-base
- name: docker/build-push-action temurin
uses: docker/build-push-action@v5
with:
context: target/docker/temurin
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.temurin.outputs.tags }}
- name: docker/build-push-action temurin-import
uses: docker/build-push-action@v5
with:
context: target/docker/temurin-import
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.temurin-import.outputs.tags }}
- name: docker/build-push-action distroless
uses: docker/build-push-action@v5
with:
context: target/docker/distroless
push: true
platforms: linux/amd64
tags: ${{ steps.distroless.outputs.tags }}
- name: docker/build-push-action distroless-import
uses: docker/build-push-action@v5
with:
context: target/docker/distroless-import
push: true
platforms: linux/amd64
tags: ${{ steps.distroless-import.outputs.tags }}