Skip to content

Commit ae49f19

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

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/test_buildx_and_publish.yml

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

2126
- name: Build image
2227
run: |
23-
docker build . -t moodle-php-apache
28+
docker build ${{matrix.phpversion}}/${{matrix.osversion}} -t moodle-php-apache
2429
2530
- name: Run tests
2631
run: |
2732
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 \
33+
-v ${{matrix.phpversion}}/${{matrix.osversion}}/tests/fixtures:/var/www/html \
34+
-v ${{matrix.phpversion}}/${{matrix.osversion}}/tests/docker-entrypoint.d:/docker-entrypoint.d \
3035
moodle-php-apache
3136
docker exec test0 php /var/www/html/test.php
3237
docker exec test0 php /var/www/html/check-ini.php
@@ -93,7 +98,7 @@ jobs:
9398
- name: Build and publish to Docker Hub and Github registries
9499
uses: docker/build-push-action@v3
95100
with:
96-
context: .
101+
context: ${{matrix.phpversion}}/${{matrix.osversion}}
97102
file: Dockerfile
98103
platforms: linux/amd64,linux/arm64
99104
push: true

0 commit comments

Comments
 (0)