Skip to content

Commit

Permalink
Build all images in one pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Mar 18, 2023
1 parent fdd388c commit ae49f19
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/test_buildx_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,24 @@ env:
jobs:
Test:
runs-on: ubuntu-latest
strategy:
matrix:
# Note: Numbers should be quoted, especially if they're a .0 release because they'll be formatted as an int.
phpversion: ["8.0", "8.1", "8.2"]
osversion: [buster, bullseye]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build image
run: |
docker build . -t moodle-php-apache
docker build ${{matrix.phpversion}}/${{matrix.osversion}} -t moodle-php-apache
- name: Run tests
run: |
docker run --name test0 -d -p 8000:80 \
-v $PWD/tests/fixtures:/var/www/html \
-v $PWD/tests/docker-entrypoint.d:/docker-entrypoint.d \
-v ${{matrix.phpversion}}/${{matrix.osversion}}/tests/fixtures:/var/www/html \
-v ${{matrix.phpversion}}/${{matrix.osversion}}/tests/docker-entrypoint.d:/docker-entrypoint.d \
moodle-php-apache
docker exec test0 php /var/www/html/test.php
docker exec test0 php /var/www/html/check-ini.php
Expand Down Expand Up @@ -93,7 +98,7 @@ jobs:
- name: Build and publish to Docker Hub and Github registries
uses: docker/build-push-action@v3
with:
context: .
context: ${{matrix.phpversion}}/${{matrix.osversion}}
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
Expand Down

0 comments on commit ae49f19

Please sign in to comment.