86 lines
2.4 KiB
YAML
86 lines
2.4 KiB
YAML
name: Build PHP Flavours
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'php/apache/**'
|
|
- 'php/cli/**'
|
|
- 'php/nginx/**'
|
|
- 'php/Dockerfile.Flavours'
|
|
pull_request:
|
|
branches:
|
|
- '!dependabot/**'
|
|
workflow_dispatch:
|
|
workflow_run:
|
|
workflows:
|
|
- Build PHP Core
|
|
branches: [ 'master', 'feature/**' ]
|
|
types:
|
|
- completed
|
|
|
|
jobs:
|
|
php-build-flavours:
|
|
name: "Build PHP Flavours"
|
|
runs-on: self-hosted
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
variant:
|
|
- cli
|
|
- nginx
|
|
- apache
|
|
version:
|
|
#- "7.0"
|
|
#- "7.1"
|
|
#- "7.2"
|
|
- "7.3"
|
|
- "7.4"
|
|
- "8.0"
|
|
- "8.1"
|
|
- "8.2"
|
|
steps:
|
|
- name: Mangle Envs
|
|
id: vars
|
|
run: |
|
|
VERSION=$(echo "${{ matrix.version }}" | tr -d '.')
|
|
PACKAGE_LIST=PHP_PACKAGES_$VERSION
|
|
echo ::set-output name=php_packages::${!PACKAGE_LIST}
|
|
- name: Show mangled envs
|
|
run: |
|
|
echo "Packages to be installed:"
|
|
echo ${{ steps.vars.outputs.php_packages }}
|
|
- uses: actions/github-script@v3
|
|
name: Build Args
|
|
id: build_args
|
|
with:
|
|
result-encoding: string
|
|
script: return `PHP_VERSION=${{ matrix.version }}\nPHP_CORE_VERSION=benzine/php:core-${{ matrix.version }}`
|
|
- uses: actions/checkout@v3
|
|
- uses: docker/setup-qemu-action@v2
|
|
- uses: docker/setup-buildx-action@v2
|
|
- uses: docker/login-action@v2
|
|
name: Login to Docker Hub
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
- uses: docker/login-action@v2
|
|
name: Login to Github Container Registry
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GHCR_PAT }}
|
|
- uses: docker/build-push-action@v3
|
|
name: Build & Push
|
|
with:
|
|
context: php
|
|
file: php/Dockerfile.Flavours
|
|
target: php-${{ matrix.variant }}
|
|
platforms: linux/amd64,linux/arm64
|
|
pull: true
|
|
push: true
|
|
tags: |
|
|
gone/php:${{ matrix.variant }}-${{ matrix.version }}
|
|
benzine/php:${{ matrix.variant }}-${{ matrix.version }}
|
|
ghcr.io/benzine-framework/php:${{ matrix.variant }}-${{ matrix.version }}
|
|
build-args: |
|
|
${{ steps.build_args.outputs.result }}
|