Skip to content

Commit 049b0e2

Browse files
committed
Build all images in one pipeline
1 parent fdd388c commit 049b0e2

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/test_buildx_and_publish.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,25 @@ env:
1414
jobs:
1515
Test:
1616
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
# Note: Numbers should be quoted, especially if they're a .0 release because they'll be formatted as an int.
21+
phpversion: ["8.0", "8.1", "8.2"]
22+
osversion: [buster, bullseye]
1723
steps:
1824
- name: Checkout
1925
uses: actions/checkout@v3
2026

2127
- name: Build image
2228
run: |
23-
docker build . -t moodle-php-apache
29+
docker build ${{matrix.phpversion}}/${{matrix.osversion}} -t moodle-php-apache
2430
2531
- name: Run tests
2632
run: |
2733
docker run --name test0 -d -p 8000:80 \
28-
-v $PWD/tests/fixtures:/var/www/html \
29-
-v $PWD/tests/docker-entrypoint.d:/docker-entrypoint.d \
34+
-v $PWD/${{matrix.phpversion}}/${{matrix.osversion}}/tests/fixtures:/var/www/html \
35+
-v $PWD/${{matrix.phpversion}}/${{matrix.osversion}}/tests/docker-entrypoint.d:/docker-entrypoint.d \
3036
moodle-php-apache
3137
docker exec test0 php /var/www/html/test.php
3238
docker exec test0 php /var/www/html/check-ini.php
@@ -49,6 +55,13 @@ jobs:
4955
# Requires Test to pass
5056
needs: Test
5157
runs-on: ubuntu-latest
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
# This matrix must match the matrix defined in the Test.
62+
# Note: Numbers should be quoted, especially if they're a .0 release because they'll be formatted as an int.
63+
phpversion: ["8.0", "8.1", "8.2"]
64+
osversion: [buster, bullseye]
5265
steps:
5366
- name: Checkout
5467
uses: actions/checkout@v3
@@ -93,7 +106,7 @@ jobs:
93106
- name: Build and publish to Docker Hub and Github registries
94107
uses: docker/build-push-action@v3
95108
with:
96-
context: .
109+
context: ${{matrix.phpversion}}/${{matrix.osversion}}
97110
file: Dockerfile
98111
platforms: linux/amd64,linux/arm64
99112
push: true

0 commit comments

Comments
 (0)