-
Notifications
You must be signed in to change notification settings - Fork 47
135 lines (133 loc) · 4.42 KB
/
release-8.2.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: release-v8.2
on:
push:
tags:
- 'v8.2.[0-9]+'
- 'v8.2.[0-9]+-beta.[0-9]+'
jobs:
docker-build:
runs-on: ubuntu-20.04
strategy:
matrix:
build:
- amd64
- 386
- arm64
- armv7
- armv6
include:
- build: amd64
arch: linux/amd64
- build: 386
arch: linux/386
- build: arm64
arch: linux/arm64
- build: armv6
arch: linux/arm/v6
- build: armv7
arch: linux/arm/v7
name: PHP 8.2 (${{ matrix.build }})
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: joseluisq/php-fpm
flavor: |
latest=true
tags: |
type=semver,pattern={{major}}.{{minor}}-${{ matrix.build }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v3
with:
push: true
context: .
platforms: ${{ matrix.arch }}
file: 8.2-fpm/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
docker-manifest:
needs: docker-build
runs-on: ubuntu-20.04
steps:
- name: Set envs
run: |
github_ref=${GITHUB_REF#refs/tags/}
SEMVER=${github_ref##*v}
echo "SEMVER=${SEMVER}" >> $GITHUB_ENV
echo "SEMVER_MAJOR=${SEMVER%.*.*}" >> $GITHUB_ENV
echo "SEMVER_MINOR=${SEMVER%.*}" >> $GITHUB_ENV
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Push semver minor alias
run: |
docker manifest create \
joseluisq/php-fpm:$SEMVER_MINOR \
--amend joseluisq/php-fpm:$SEMVER_MINOR-amd64 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-386 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-arm64 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-armv6 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-armv7
docker manifest push joseluisq/php-fpm:$SEMVER_MINOR
-
name: Push latest (PHP 8.2 or newer)
run: |
docker manifest create \
joseluisq/php-fpm:latest \
--amend joseluisq/php-fpm:$SEMVER_MINOR-amd64 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-386 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-arm64 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-armv6 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-armv7
docker manifest push joseluisq/php-fpm:latest
-
name: Pull all images
run: |
docker pull joseluisq/php-fpm:$SEMVER_MINOR-amd64
docker pull joseluisq/php-fpm:$SEMVER_MINOR-386
docker pull joseluisq/php-fpm:$SEMVER_MINOR-arm64
docker pull joseluisq/php-fpm:$SEMVER_MINOR-armv6
docker pull joseluisq/php-fpm:$SEMVER_MINOR-armv7
-
name: Push semver alias
run: |
docker manifest create \
joseluisq/php-fpm:$SEMVER \
--amend joseluisq/php-fpm:$SEMVER_MINOR-amd64 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-386 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-arm64 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-armv6 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-armv7
docker manifest push joseluisq/php-fpm:$SEMVER
-
name: Push semver major alias (PHP 8.2 or newer)
run: |
docker manifest create \
joseluisq/php-fpm:$SEMVER_MAJOR \
--amend joseluisq/php-fpm:$SEMVER_MINOR-amd64 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-386 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-arm64 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-armv6 \
--amend joseluisq/php-fpm:$SEMVER_MINOR-armv7
docker manifest push joseluisq/php-fpm:$SEMVER_MAJOR