Skip to content

Commit 763648a

Browse files
committed
Use matrix deployment
1 parent 72d4414 commit 763648a

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.github/workflows/publish_docker.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ jobs:
1313
contents: read
1414
packages: write
1515

16+
strategy:
17+
matrix:
18+
php: ["8.2", "8.3"]
19+
composer: ["2.2", "2"]
20+
fail-fast: false
21+
1622
steps:
1723
- name: Checkout code
1824
uses: actions/checkout@v4
@@ -27,17 +33,14 @@ jobs:
2733
username: ${{ github.actor }}
2834
password: ${{ secrets.GITHUB_TOKEN }}
2935

30-
- name: Extract versions
31-
id: vars
32-
run: |
33-
php=$(grep 'ARG PHP_VERSION' Dockerfile | cut -d= -f2)
34-
composer=$(grep 'ARG COMPOSER_VERSION' Dockerfile | cut -d= -f2)
35-
echo "tag=$php-$composer" >> $GITHUB_OUTPUT
36-
3736
- name: Build and push multi-arch image
3837
uses: docker/build-push-action@v6
3938
with:
4039
context: .
4140
push: true
4241
platforms: linux/amd64,linux/arm64
43-
tags: ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag }}
42+
build-args: |
43+
PHP_VERSION=${{ matrix.php }}
44+
COMPOSER_VERSION=${{ matrix.composer }}
45+
tags: |
46+
ghcr.io/${{ github.repository }}:${{ matrix.php }}-${{ matrix.composer }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ubuntu:22.04
33
ARG DEBIAN_FRONTEND=noninteractive
44

55
# Allow PHP version and composer version to be overriden
6-
ARG PHP_VERSION=8.2.29
6+
ARG PHP_VERSION=8.2
77
ARG COMPOSER_VERSION=2.2
88

99
ENV LANG=en_US.UTF-8 \

0 commit comments

Comments
 (0)