-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (107 loc) · 3.33 KB
/
make-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Make images
on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
jobs:
build_fpm:
runs-on: ubuntu-latest
name: 'Build fpm and push images'
strategy:
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
steps:
- name: "Authenticate DockerHub Account"
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: "Initialize Docker build environment"
uses: docker/setup-buildx-action@v3
- name: "Checkout the current branch"
uses: actions/checkout@v4
- name: "Build FPM image for specific version"
if: vars.LATEST_VERSION != matrix.php-version
uses: docker/build-push-action@v6
with:
build-args: |
PHP_VERSION=${{ matrix.php-version }}
context: fpm/.
platforms: |
linux/amd64
pull: true
push: true
tags: |
${{ vars.REPOSITORY_NAME }}:${{ matrix.php-version }}-fpm
- name: "Build and push FPM image for latest version"
if: vars.LATEST_VERSION == matrix.php-version
uses: docker/build-push-action@v6
with:
build-args: |
PHP_VERSION=${{ matrix.php-version }}
context: fpm/.
platforms: |
linux/amd64
pull: true
push: true
tags: |
${{ vars.REPOSITORY_NAME }}:${{ matrix.php-version }}-fpm
${{ vars.REPOSITORY_NAME }}:latest-fpm
build_nginx:
runs-on: ubuntu-latest
name: 'Build nginx and push images'
needs:
- build_fpm
strategy:
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
steps:
- name: "Authenticate DockerHub Account"
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Initialize Docker build environment"
uses: docker/setup-buildx-action@v3
- name: "Checkout the current branch"
uses: actions/checkout@v4
- name: "Build and push nginx image for latest version"
if: vars.LATEST_VERSION == matrix.php-version
uses: docker/build-push-action@v6
with:
build-args: |
FROM_FPM_IMAGE=${{ vars.REPOSITORY_NAME }}:${{ matrix.php-version }}-fpm
PHP_VERSION=${{ matrix.php-version }}
context: nginx/.
platforms: |
linux/amd64
pull: true
push: true
tags: |
${{ vars.REPOSITORY_NAME }}:${{ matrix.php-version }}-nginx
${{ vars.REPOSITORY_NAME }}:latest-nginx
- name: "Build nginx image for specific version"
uses: docker/build-push-action@v6
with:
build-args: |
FROM_FPM_IMAGE=${{ vars.REPOSITORY_NAME }}:${{ matrix.php-version }}-fpm
PHP_VERSION=${{ matrix.php-version }}
context: nginx/.
platforms: |
linux/amd64
pull: true
push: true
tags: |
${{ vars.REPOSITORY_NAME }}:${{ matrix.php-version }}-nginx