php/.gitea/workflows/php8-alpine.yaml

198 lines
6.9 KiB
YAML

name: Build and push PHP 8 container images
on:
push:
branches:
- php8-alpine
jobs:
builder:
name: Build PHP 8 builder container images
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
strategy:
matrix:
flavors:
- os: "alpine"
os_version: "3.16"
php_version: "8.0"
php_ver_short: "8"
- os: "alpine"
os_version: "3.19"
php_version: "8.1"
php_ver_short: "81"
- os: "alpine"
os_version: "3.21"
php_version: "8.2"
php_ver_short: "83"
- os: "alpine"
os_version: "3.21"
php_version: "8.3"
php_ver_short: "83"
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Login to quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ vars.QUAY_USERNAME }}
password: ${{ secrets.QUAY_SECRET }}
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and push php8 builder
uses: docker/build-push-action@v5
with:
push: true
context: .
file: 8/Dockerfile.${{ matrix.flavors.os }}-builder
build-args: |
OS_VERSION=${{ matrix.flavors.os_version }}
PHP_VERSION=${{ matrix.flavors.php_version }}
PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }}
tags: |
quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-builder-${{ matrix.flavors.os }}
# flavors:
# name: Build PHP 8 container images
# runs-on: ubuntu-latest
# needs:
# - builder
# container:
# image: ghcr.io/catthehacker/ubuntu:act-latest
# strategy:
# matrix:
# flavors:
# - os: "alpine"
# os_version: "3.9"
# php_version: "8.2"
# php_ver_short: "8"
# with_server: "false"
# with_database: "false"
# - os: "alpine"
# os_version: "3.12"
# php_version: "8.3"
# php_ver_short: "8"
# with_server: "false"
# with_database: "false"
# - os: "alpine"
# os_version: "3.15"
# php_version: "8.4"
# php_ver_short: "8"
# with_server: "false"
# with_database: "false"
# - os: "alpine"
# os_version: "3.9"
# php_version: "8.2"
# php_ver_short: "8"
# with_server: "apache"
# with_database: "false"
# - os: "alpine"
# os_version: "3.12"
# php_version: "8.3"
# php_ver_short: "8"
# with_server: "apache"
# with_database: "false"
# - os: "alpine"
# os_version: "3.15"
# php_version: "8.4"
# php_ver_short: "8"
# with_server: "apache"
# with_database: "false"
# - os: "alpine"
# os_version: "3.9"
# php_version: "8.2"
# php_ver_short: "8"
# with_server: "apache"
# with_database: "mysql"
# - os: "alpine"
# os_version: "3.12"
# php_version: "8.3"
# php_ver_short: "8"
# with_server: "apache"
# with_database: "mysql"
# - os: "alpine"
# os_version: "3.15"
# php_version: "8.4"
# php_ver_short: "8"
# with_server: "apache"
# with_database: "mysql"
# - os: "alpine"
# os_version: "3.9"
# php_version: "8.2"
# php_ver_short: "8"
# with_server: "apache"
# with_database: "postgresql"
# - os: "alpine"
# os_version: "3.12"
# php_version: "8.3"
# php_ver_short: "8"
# with_server: "apache"
# with_database: "postgresql"
# - os: "alpine"
# os_version: "3.15"
# php_version: "8.4"
# php_ver_short: "8"
# with_server: "apache"
# with_database: "postgresql"
# steps:
# - name: Check out repository code
# uses: actions/checkout@v4
# - name: Login to quay.io
# uses: docker/login-action@v3
# with:
# registry: quay.io
# username: ${{ vars.QUAY_USERNAME }}
# password: ${{ secrets.QUAY_SECRET }}
# # - name: Set up QEMU
# # uses: docker/setup-qemu-action@v3
# - name: Setup Docker buildx
# uses: docker/setup-buildx-action@v3
# - if: ${{ matrix.flavors.with_server == 'false' && matrix.flavors.with_database == 'false' }}
# name: Build and push php8
# uses: docker/build-push-action@v5
# with:
# push: true
# context: .
# file: 8/Dockerfile.${{ matrix.flavors.os }}
# build-args: |
# OS_VERSION=${{ matrix.flavors.os_version }}
# PHP_VERSION=${{ matrix.flavors.php_version }}
# PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }}
# tags: |
# quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.os }}
# - if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database == 'false' }}
# name: Build and push php8 with webserver
# uses: docker/build-push-action@v5
# with:
# push: true
# context: .
# file: 8/Dockerfile.${{ matrix.flavors.os }}-${{ matrix.flavors.with_server }}
# build-args: |
# OS_VERSION=${{ matrix.flavors.os_version }}
# PHP_VERSION=${{ matrix.flavors.php_version }}
# PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }}
# WITH_APACHE=true
# tags: |
# quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }}
# - if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database != 'false' }}
# name: Build and push php8 with webserver and database connector library
# uses: docker/build-push-action@v5
# with:
# push: true
# context: .
# file: 8/Dockerfile.${{ matrix.flavors.os }}-${{ matrix.flavors.with_server }}
# build-args: |
# OS_VERSION=${{ matrix.flavors.os_version }}
# PHP_VERSION=${{ matrix.flavors.php_version }}
# PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }}
# WITH_APACHE=true
# WITH_DATABASE=${{ matrix.flavors.with_database }}
# tags: |
# quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.with_database }}-${{ matrix.flavors.os }}