@@ -3,8 +3,6 @@ name: CI/CD
33on :
44 push :
55 workflow_dispatch :
6- schedule :
7- - cron : ' 0 0 * * 0'
86
97env :
108 DOCKER_BUILDKIT : 1
@@ -19,17 +17,27 @@ jobs:
1917
2018 steps :
2119 - name : Checkout code
22- uses : actions/checkout@master
20+ uses : actions/checkout@v3
2321
24- - name : Build image
25- run : |
26- docker build \
27- --tag kooldev/wordpress:${{ matrix.version }}${{ matrix.type }} \
28- ${{ matrix.version }}${{ matrix.type }}
22+ - name : Setup QEMU
23+ uses : docker/setup-qemu-action@v2
24+
25+ - name : Setup Docker Buildx
26+ uses : docker/setup-buildx-action@v2
27+
28+ - name : Build and export to Docker
29+ uses : docker/build-push-action@v3
30+ with :
31+ context : ${{ matrix.version }}${{ matrix.type }}
32+ load : true
33+ tags : kooldev/wordpress:${{ matrix.version }}${{ matrix.type }}
2934
30- docker build \
31- --tag kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} \
32- ${{ matrix.version }}-nginx${{ matrix.type }}
35+ - name : Build and export to Docker (nginx)
36+ uses : docker/build-push-action@v3
37+ with :
38+ context : ${{ matrix.version }}-nginx${{ matrix.type }}
39+ load : true
40+ tags : kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }}
3341
3442 - name : Test docker images PHP executable
3543 run : |
4856 docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} php /kool/wordpress/index.php
4957
5058 - name : Login to DockerHub
51- uses : docker/login-action@v1
59+ uses : docker/login-action@v2
5260 if : github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-wordpress'
5361 with :
5462 username : ${{ secrets.DOCKER_USERNAME }}
5967 run : |
6068 docker push kooldev/wordpress:${{ matrix.version }}${{ matrix.type }}
6169 docker push kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }}
70+
71+ - name : Build and push
72+ uses : docker/build-push-action@v3
73+ if : github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-wordpress'
74+ with :
75+ context : ${{ matrix.version }}${{ matrix.type }}
76+ platforms : linux/amd64,linux/arm64
77+ push : true
78+ tags : kooldev/wordpress:${{ matrix.version }}${{ matrix.type }}
79+
80+ - name : Build and push (nginx)
81+ uses : docker/build-push-action@v3
82+ if : github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-wordpress'
83+ with :
84+ context : ${{ matrix.version }}-nginx${{ matrix.type }}
85+ platforms : linux/amd64,linux/arm64
86+ push : true
87+ tags : kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }}
0 commit comments