Skip to content

Commit 4ff8e6b

Browse files
authored
Merge pull request #11 from amenophis/ci
Add CI to build and push docker images automatically
2 parents 9d75c43 + 3993930 commit 4ff8e6b

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/build-push.yaml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build and push docker images
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build-and-push:
11+
name: Build and Push docker images for ${{ matrix.php }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
16+
steps:
17+
-
18+
name: Checkout
19+
uses: actions/checkout@v4
20+
21+
-
22+
name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
-
26+
name: Login to Docker Hub
27+
uses: docker/login-action@v3
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
32+
-
33+
name: Build and push base
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: "./${{ matrix.php }}/base"
37+
platforms: linux/amd64,linux/arm64
38+
push: true
39+
tags: ${{ format('amenophis/nginx-php-fpm:{0}{1}', matrix.php, github.event.event_name == 'pull_request' && format('-{0}', github.event.number) || '') }}
40+
41+
-
42+
name: Build and push php-all-exts
43+
uses: docker/build-push-action@v5
44+
with:
45+
context: "./${{ matrix.php }}/php-all-exts"
46+
platforms: linux/amd64,linux/arm64
47+
push: true
48+
tags: ${{ format('amenophis/nginx-php-fpm:{0}-all-exts{1}', matrix.php, github.event.event_name == 'pull_request' && format('-{0}', github.event.number) || '') }}

0 commit comments

Comments
 (0)