diff --git a/.github/workflows/build-image-common.yml b/.github/workflows/build-image-common.yml index a0709f1..3314bb4 100644 --- a/.github/workflows/build-image-common.yml +++ b/.github/workflows/build-image-common.yml @@ -12,6 +12,9 @@ on: cache_scope: required: true type: string + build_args: + required: false + type: string jobs: build-and-push: @@ -40,5 +43,6 @@ jobs: context: ${{ inputs.context }} push: true tags: ${{ inputs.image_tag }} + build-args: ${{ inputs.build_args }} cache-from: type=gha,scope=${{ inputs.cache_scope }} cache-to: type=gha,mode=max,scope=${{ inputs.cache_scope }} \ No newline at end of file diff --git a/.github/workflows/build-whmcs-php-fpm.yml b/.github/workflows/build-whmcs-php-fpm.yml index 7d99e65..d7c4b0b 100644 --- a/.github/workflows/build-whmcs-php-fpm.yml +++ b/.github/workflows/build-whmcs-php-fpm.yml @@ -11,8 +11,22 @@ on: jobs: build: + strategy: + fail-fast: false + matrix: + php: [ "7.2", "7.3", "7.4", "8.1", "8.2", "8.3" ] + include: + # Mark the "latest" for 8.3 + - php: "8.3" + latest: true + uses: ./.github/workflows/build-image-common.yml with: context: whmcs-php-fpm - image_tag: ghcr.io/edythecow/whmcs-php-fpm:latest - cache_scope: whmcs-php-fpm \ No newline at end of file + # Always tag with php- and tag latest for 8.3 + image_tag: | + ghcr.io/edythecow/whmcs-php-fpm:php-${{ matrix.php }} + ${{ matrix.latest && 'ghcr.io/edythecow/whmcs-php-fpm:latest' || '' }} + cache_scope: whmcs-php-fpm-${{ matrix.php }} + build_args: | + PHP_VERSION=${{ matrix.php }} \ No newline at end of file diff --git a/whmcs-php-fpm/Dockerfile b/whmcs-php-fpm/Dockerfile index 90733a9..9fc049d 100644 --- a/whmcs-php-fpm/Dockerfile +++ b/whmcs-php-fpm/Dockerfile @@ -1,4 +1,5 @@ -FROM php:8.3-fpm-bookworm +ARG PHP_VERSION=8.3 +FROM php:${PHP_VERSION}-fpm # Fetch the helper ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/