-
Notifications
You must be signed in to change notification settings - Fork 20
184 lines (156 loc) · 8.22 KB
/
build_container.yml
File metadata and controls
184 lines (156 loc) · 8.22 KB
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
---
name: Build and publish a 🛢️ container
on:
push:
branches:
- 'main'
tags:
- '*'
workflow_dispatch:
permissions:
contents: read # minimal required permissions to clone repo
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
build_matrix: ${{ steps.set-build-matrix.outputs.build_matrix }}
tag_matrix: ${{ steps.set-tag-matrix.outputs.tag_matrix }}
steps:
- name: Source checkout
uses: actions/checkout@v5
- name: 'Setup yq'
uses: dcarbone/install-yq-action@v1.3.1
- id: set-build-matrix
run: echo "build_matrix=$(bash matrix.sh build)" >> $GITHUB_OUTPUT
- id: set-tag-matrix
run: echo "tag_matrix=$(bash matrix.sh tag)" >> $GITHUB_OUTPUT
build-and-push-container:
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.build_matrix) }}
steps:
- id: server_version
run: echo "server_version=${{ matrix.server_version }}" | cut -d- -f1 >> $GITHUB_OUTPUT
- id: db_version
run: echo "db_version=${{ matrix.db_version }}" | cut -d- -f1 >> $GITHUB_OUTPUT
- name: Build OpenVox Server ${{ matrix.release }} container
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: |
OPENVOX_RELEASE=${{ matrix.release }}
OPENVOXSERVER_VERSION=${{ matrix.server_version }}
OPENVOXDB_VERSION=${{ matrix.db_version }}
R10K_VERSION=${{ matrix.r10k_version }}
RUGGED_VERSION=${{ matrix.rugged_version }}
JDK_VERSION=${{ matrix.jdk_version }}
build_arch: linux/${{ matrix.platform }}
build_context: openvoxserver
buildfile: openvoxserver/Containerfile
tags: |
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-${{ matrix.platform }}
- name: Build Alpine OpenVox Server ${{ matrix.release }} container
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: |
OPENVOX_RELEASE=${{ matrix.release }}
OPENVOXSERVER_VERSION=${{ steps.server_version.outputs.server_version }}
OPENVOXDB_VERSION=${{ steps.db_version.outputs.db_version }}
R10K_VERSION=${{ matrix.r10k_version }}
RUGGED_VERSION=${{ matrix.rugged_version }}
JDK_VERSION=${{ matrix.jdk_version }}
build_arch: linux/${{ matrix.platform }}
build_context: openvoxserver
buildfile: openvoxserver/Containerfile.alpine
tags: |
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-${{ matrix.platform }}-alpine
create-multi-arch-manifests:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs:
- setup-matrix
- build-and-push-container
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.tag_matrix) }}
steps:
- name: Log in to the ghcr.io registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the docker.io registry
uses: docker/login-action@v3
with:
registry: docker.io
username: voxpupulibot
password: ${{ secrets.DOCKERHUB_BOT_ADMIN_TOKEN }}
- id: server_version
run: echo "server_version=${{ matrix.server_version }}" | cut -d- -f1 >> $GITHUB_OUTPUT
- id: db_version
run: echo "db_version=${{ matrix.db_version }}" | cut -d- -f1 >> $GITHUB_OUTPUT
- name: Create multi arch manifests
run: |
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ steps.server_version.outputs.server_version }}-${{ github.ref_name }} \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-amd64
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }} \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-amd64
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:latest \
ghcr.io/openvoxproject/openvoxserver:8-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:8-${{ github.sha }}-amd64
# on docker.io we use the voxpupuli namespace because new organizations are not free anymore
#
docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ steps.server_version.outputs.server_version }}-${{ github.ref_name }} \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-amd64
docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ matrix.release }} \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-amd64
docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:latest \
ghcr.io/openvoxproject/openvoxserver:8-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:8-${{ github.sha }}-amd64
- name: Create Alpine multi arch manifests
run: |
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ steps.server_version.outputs.server_version }}-${{ github.ref_name }}-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-amd64-alpine
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-amd64-alpine
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:latest-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:8-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:8-${{ github.sha }}-amd64-alpine
# on docker.io we use the voxpupuli namespace because new organizations are not free anymore
docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ steps.server_version.outputs.server_version }}-${{ github.ref_name }}-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-amd64-alpine
docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ matrix.release }}-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-amd64-alpine
docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:latest-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:8-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:8-${{ github.sha }}-amd64-alpine
update-dockerhub-description:
runs-on: ubuntu-latest
permissions:
contents: read
needs:
- create-multi-arch-manifests
steps:
- name: Source checkout
uses: actions/checkout@v5
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v5
with:
username: voxpupulibot
password: ${{ secrets.DOCKERHUB_BOT_ADMIN_TOKEN }}
repository: voxpupuli/openvoxserver