Skip to content

Commit 63f7001

Browse files
Enhance GitHub Actions workflow to build and push Docker images for multiple PHP versions
1 parent d7ebb23 commit 63f7001

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/docker-build-and-push.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1+
12
name: Build and Push Docker Image
23

34
on:
45
push:
56
branches:
67
- main
78

9+
env:
10+
latest_version: 84
11+
812
jobs:
913
build-and-push:
1014
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
php_version: [82, 83, 84]
1118

1219
steps:
1320
- name: Checkout code
@@ -27,4 +34,8 @@ jobs:
2734
with:
2835
context: .
2936
push: true
30-
tags: manudonihubcoreai/composer:latest
37+
tags: |
38+
manudonihubcoreai/composer:${{ matrix.php_version }}
39+
${{ matrix.php_version == env.latest_version && 'manudonihubcoreai/composer:latest' || '' }}
40+
build-args: |
41+
PHP_VERSION=${{ matrix.php_version }}

0 commit comments

Comments
 (0)