Skip to content

Commit b2c975a

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

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/test_buildx_and_publish.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,23 @@ env:
1414
jobs:
1515
Test:
1616
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
phpversion: [8.0, 8.1, 8.2]
20+
osversion: [buster, bullseye]
1721
steps:
1822
- name: Checkout
1923
uses: actions/checkout@v3
2024

2125
- name: Build image
2226
run: |
23-
docker build . -t moodle-php-apache
27+
docker build ${{matrix.phpversion}}/${{matrix.osversion}} -t moodle-php-apache
2428
2529
- name: Run tests
2630
run: |
2731
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 \
32+
-v ${{matrix.phpversion}}/${{matrix.osversion}}/tests/fixtures:/var/www/html \
33+
-v ${{matrix.phpversion}}/${{matrix.osversion}}/tests/docker-entrypoint.d:/docker-entrypoint.d \
3034
moodle-php-apache
3135
docker exec test0 php /var/www/html/test.php
3236
docker exec test0 php /var/www/html/check-ini.php
@@ -93,7 +97,7 @@ jobs:
9397
- name: Build and publish to Docker Hub and Github registries
9498
uses: docker/build-push-action@v3
9599
with:
96-
context: .
100+
context: ${{matrix.phpversion}}/${{matrix.osversion}}
97101
file: Dockerfile
98102
platforms: linux/amd64,linux/arm64
99103
push: true

0 commit comments

Comments
 (0)