@@ -3,8 +3,6 @@ name: CI/CD
3
3
on :
4
4
push :
5
5
workflow_dispatch :
6
- schedule :
7
- - cron : ' 0 0 * * 0'
8
6
9
7
env :
10
8
DOCKER_BUILDKIT : 1
@@ -19,17 +17,27 @@ jobs:
19
17
20
18
steps :
21
19
- name : Checkout code
22
- uses : actions/checkout@master
20
+ uses : actions/checkout@v3
23
21
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 }}
29
34
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 }}
33
41
34
42
- name : Test docker images PHP executable
35
43
run : |
48
56
docker run kooldev/wordpress:${{ matrix.version }}-nginx${{ matrix.type }} php /kool/wordpress/index.php
49
57
50
58
- name : Login to DockerHub
51
- uses : docker/login-action@v1
59
+ uses : docker/login-action@v2
52
60
if : github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-wordpress'
53
61
with :
54
62
username : ${{ secrets.DOCKER_USERNAME }}
59
67
run : |
60
68
docker push kooldev/wordpress:${{ matrix.version }}${{ matrix.type }}
61
69
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