-
-
Notifications
You must be signed in to change notification settings - Fork 14
265 lines (251 loc) · 10.1 KB
/
main-docker-image-php-fpm-wordpress-web.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
---
name: "PHP-FPM Wordpress Web • Docker Build"
on:
workflow_dispatch:
workflow_run:
workflows: [ "PHP-FPM Wordpress • Docker Build" ]
branches: [ main ]
types:
- completed
pull_request:
push:
paths:
- images/php-fpm/wordpress-web/.trigger
branches:
- main
jobs:
test:
name: "Run tests"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Install bashunit"
run: |
curl -s https://bashunit.typeddevs.com/install.sh | bash -s -- /usr/local/bin
- name: "Test"
run: 'find images/php-fpm/wordpress-web/ -name "*_test.sh" -type f -print0 | xargs -0 -t bashunit'
build:
name: "Build php-fpm/wordpress-web"
needs: [ test ]
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
BASE_IMAGE_NAME: [ "debian", "ubuntu" ]
BASE_IMAGE_TAG: [ "bullseye", "bookworm", "jammy" ]
PHP_VERSION: [ "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" ]
exclude:
# Exclude PHP 5.6, 7.0, 7.1, 7.2, 7.3, 7.4 on Debian Bookworm
- BASE_IMAGE_NAME: debian
BASE_IMAGE_TAG: bookworm
PHP_VERSION: "5.6"
- BASE_IMAGE_NAME: debian
BASE_IMAGE_TAG: bookworm
PHP_VERSION: "7.0"
- BASE_IMAGE_NAME: debian
BASE_IMAGE_TAG: bookworm
PHP_VERSION: "7.1"
- BASE_IMAGE_NAME: debian
BASE_IMAGE_TAG: bookworm
PHP_VERSION: "7.2"
- BASE_IMAGE_NAME: debian
BASE_IMAGE_TAG: bookworm
PHP_VERSION: "7.3"
- BASE_IMAGE_NAME: debian
BASE_IMAGE_TAG: bookworm
PHP_VERSION: "7.4"
# jammy is an ubuntu distro
- BASE_IMAGE_NAME: debian
BASE_IMAGE_TAG: jammy
# bullseye and bookworm are debian distros
- BASE_IMAGE_NAME: ubuntu
BASE_IMAGE_TAG: bullseye
- BASE_IMAGE_NAME: ubuntu
BASE_IMAGE_TAG: bookworm
# debian-bullseye images are the default and will be built with and without '-debian-bullseye' suffix
include:
- BASE_IMAGE_NAME: debian
BASE_IMAGE_TAG: bullseye
DEFAULT_IMAGE: "true"
steps:
- uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
image: mirror.gcr.io/tonistiigi/binfmt:latest
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: image=moby/buildkit:master
config-inline: |
[registry."docker.io"]
mirrors = ["${{ secrets.DOCKER_PROXY }}"]
- uses: supplypike/setup-bin@v3
with:
uri: https://github.com/hairyhenderson/gomplate/releases/latest/download/gomplate_linux-amd64
name: gomplate
version: latest
- name: Generate Dockerfile
run: gomplate -f images/php-fpm/wordpress-web/tpl.Dockerfile -o images/php-fpm/wordpress-web/Dockerfile
env:
BASE_IMAGE_NAME: ${{ matrix.BASE_IMAGE_NAME }}
BASE_IMAGE_TAG: ${{ matrix.BASE_IMAGE_TAG }}
- name: Build and push default image
uses: docker/build-push-action@v5
if: ${{ matrix.DEFAULT_IMAGE == 'true' }}
with:
context: images/php-fpm/wordpress-web/context
file: images/php-fpm/wordpress-web/Dockerfile
push: true
platforms: "linux/amd64,linux/arm64"
tags: |
${{ vars.DOCKER_REPO }}/php-fpm:${{ matrix.PHP_VERSION }}-wordpress-web
${{ vars.DOCKER_REPO }}/php-fpm:${{ matrix.PHP_VERSION }}-wordpress-web-${{ matrix.BASE_IMAGE_NAME }}-${{ matrix.BASE_IMAGE_TAG }}
build-args: PHP_VERSION=${{ matrix.PHP_VERSION }}
cache-from: type=registry,ref=${{ vars.DOCKER_REPO }}/php-fpm:${{ matrix.PHP_VERSION }}-wordpress-web-${{ matrix.BASE_IMAGE_NAME }}-${{ matrix.BASE_IMAGE_TAG }}
cache-to: type=inline
- name: Build and push default image
uses: docker/build-push-action@v5
if: ${{ matrix.DEFAULT_IMAGE != 'true' }}
with:
context: images/php-fpm/wordpress-web/context
file: images/php-fpm/wordpress-web/Dockerfile
push: true
platforms: "linux/amd64,linux/arm64"
tags: |
${{ vars.DOCKER_REPO }}/php-fpm:${{ matrix.PHP_VERSION }}-wordpress-web-${{ matrix.BASE_IMAGE_NAME }}-${{ matrix.BASE_IMAGE_TAG }}
build-args: PHP_VERSION=${{ matrix.PHP_VERSION }}
cache-from: type=registry,ref=${{ vars.DOCKER_REPO }}/php-fpm:${{ matrix.PHP_VERSION }}-wordpress-web-${{ matrix.BASE_IMAGE_NAME }}-${{ matrix.BASE_IMAGE_TAG }}
cache-to: type=inline
# wordpress-web-apps:
# name: php-fpm/wordpress-web-apps
# runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
# needs:
# - php-fpm-wordpress-web
# strategy:
# matrix:
# BASE_IMAGE_NAME: [ "debian", "ubuntu" ]
# BASE_IMAGE_TAG: [ "bullseye", "bookworm", "jammy" ]
# PHP_VERSION: [ "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" ]
# APP: [ "blackfire", "spx", "xdebug2", "xdebug3" ]
# exclude:
# # Exclude PHP 5.6, 7.0, 7.1, 7.2, 7.3, 7.4 on Debian Bookworm
# - BASE_IMAGE_NAME: debian
# BASE_IMAGE_TAG: bookworm
# PHP_VERSION: "5.6"
# - BASE_IMAGE_NAME: debian
# BASE_IMAGE_TAG: bookworm
# PHP_VERSION: "7.0"
# - BASE_IMAGE_NAME: debian
# BASE_IMAGE_TAG: bookworm
# PHP_VERSION: "7.1"
# - BASE_IMAGE_NAME: debian
# BASE_IMAGE_TAG: bookworm
# PHP_VERSION: "7.2"
# - BASE_IMAGE_NAME: debian
# BASE_IMAGE_TAG: bookworm
# PHP_VERSION: "7.3"
# - BASE_IMAGE_NAME: debian
# BASE_IMAGE_TAG: bookworm
# PHP_VERSION: "7.4"
#
# # jammy is an ubuntu distro
# - BASE_IMAGE_NAME: debian
# BASE_IMAGE_TAG: jammy
#
# # bullseye and bookworm are debian distros
# - BASE_IMAGE_NAME: ubuntu
# BASE_IMAGE_TAG: bullseye
# - BASE_IMAGE_NAME: ubuntu
# BASE_IMAGE_TAG: bookworm
#
# # exclude xdebug2 on php 8.0, 8.1, 8.2, 8.3
# - PHP_VERSION: "8.0"
# APP: "xdebug2"
# - PHP_VERSION: "8.1"
# APP: "xdebug2"
# - PHP_VERSION: "8.2"
# APP: "xdebug2"
# - PHP_VERSION: "8.3"
# APP: "xdebug2"
#
# # debian-bullseye images are the default and will be built with and without '-debian-bullseye' suffix
# include:
# - BASE_IMAGE_NAME: debian
# BASE_IMAGE_TAG: bullseye
# DEFAULT_IMAGE: "true"
# steps:
# - uses: actions/checkout@v4
#
# - name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
#
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# with:
# image: mirror.gcr.io/tonistiigi/binfmt:latest
#
# - name: Set up Docker Buildx
# id: buildx
# uses: docker/setup-buildx-action@v3
# with:
# driver-opts: image=moby/buildkit:master
# config-inline: |
# [registry."docker.io"]
# mirrors = ["${{ secrets.DOCKER_PROXY }}"]
#
# - uses: supplypike/setup-bin@v3
# with:
# uri: https://github.com/hairyhenderson/gomplate/releases/latest/download/gomplate_linux-amd64
# name: gomplate
# version: latest
#
# - name: Generate Dockerfile
# run: gomplate -f images/php-fpm/${{ matrix.APP }}/tpl.Dockerfile -o images/php-fpm/${{ matrix.APP }}/Dockerfile
# env:
# BASE_IMAGE_NAME: ${{ matrix.BASE_IMAGE_NAME }}
# BASE_IMAGE_TAG: ${{ matrix.BASE_IMAGE_TAG }}
# PHP_VARIANT: "wordpress-web"
#
# - name: Build and push default image
# uses: docker/build-push-action@v5
# if: ${{ matrix.DEFAULT_IMAGE == 'true' }}
# with:
# context: images/php-fpm/${{ matrix.APP }}/context
# file: images/php-fpm/${{ matrix.APP }}/Dockerfile
# push: true
# platforms: "linux/amd64,linux/arm64"
# tags: |
# ${{ vars.DOCKER_REPO }}/php-fpm:${{ matrix.PHP_VERSION }}-wordpress-web-${{ matrix.APP }}
# ${{ vars.DOCKER_REPO }}/php-fpm:${{ matrix.PHP_VERSION }}-wordpress-web-${{ matrix.APP }}-${{ matrix.BASE_IMAGE_NAME }}-${{ matrix.BASE_IMAGE_TAG }}
# build-args: |
# PHP_VERSION=${{ matrix.PHP_VERSION }}
# cache-from: type=registry,ref=${{ vars.DOCKER_REPO }}/php-fpm:${{ matrix.PHP_VERSION }}-wordpress-web-${{ matrix.APP }}-${{ matrix.BASE_IMAGE_NAME }}-${{ matrix.BASE_IMAGE_TAG }}
# cache-to: type=inline
#
# - name: Build and push default image
# uses: docker/build-push-action@v5
# if: ${{ matrix.DEFAULT_IMAGE != 'true' }}
# with:
# context: images/php-fpm/${{ matrix.APP }}/context
# file: images/php-fpm/${{ matrix.APP }}/Dockerfile
# push: true
# platforms: "linux/amd64,linux/arm64"
# tags: |
# ${{ vars.DOCKER_REPO }}/php-fpm:${{ matrix.PHP_VERSION }}-wordpress-web-${{ matrix.APP }}-${{ matrix.BASE_IMAGE_NAME }}-${{ matrix.BASE_IMAGE_TAG }}
# build-args: |
# PHP_VERSION=${{ matrix.PHP_VERSION }}
# cache-from: type=registry,ref=${{ vars.DOCKER_REPO }}/php-fpm:${{ matrix.PHP_VERSION }}-wordpress-web-${{ matrix.APP }}-${{ matrix.BASE_IMAGE_NAME }}-${{ matrix.BASE_IMAGE_TAG }}
# cache-to: type=inline