@@ -17,11 +17,25 @@ jobs:
1717 - name : Checkout code
1818 uses : actions/checkout@v3.1.0
1919
20- - name : Build
21- run : |
22- docker build \
23- --tag kooldev/phpqa:${{ matrix.version }} \
24- ${{ matrix.version }}
20+ - name : Setup QEMU
21+ uses : docker/setup-qemu-action@v2
22+
23+ - name : Setup Docker Buildx
24+ uses : docker/setup-buildx-action@v2
25+
26+ - name : Login to DockerHub
27+ uses : docker/login-action@v2
28+ if : github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa'
29+ with :
30+ username : ${{ secrets.DOCKER_USERNAME }}
31+ password : ${{ secrets.DOCKER_PASSWORD }}
32+
33+ - name : Build and export to Docker
34+ uses : docker/build-push-action@v3
35+ with :
36+ context : ${{ matrix.version }}
37+ load : true
38+ tags : kooldev/phpqa:${{ matrix.version }}
2539
2640 - name : Tests
2741 run : |
@@ -33,14 +47,11 @@ jobs:
3347 docker run kooldev/phpqa:${{ matrix.version }} php-cs-fixer --version
3448 docker run kooldev/phpqa:${{ matrix.version }} local-php-security-checker -help
3549
36- - name : Login to DockerHub
37- uses : docker/login- action@v2.1.0
50+ - name : Build and push
51+ uses : docker/build-push- action@v3
3852 if : github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa'
3953 with :
40- username : ${{ secrets.DOCKER_USERNAME }}
41- password : ${{ secrets.DOCKER_PASSWORD }}
42-
43- - name : Push to DockerHub
44- if : github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa'
45- run : |
46- docker push kooldev/phpqa:${{ matrix.version }}
54+ context : ${{ matrix.version }}
55+ platforms : linux/amd64,linux/arm64
56+ push : true
57+ tags : kooldev/phpqa:${{ matrix.version }}
0 commit comments