Docker-Swarm-Loadbalancer/.github/workflows/php-flavours.yml
Matthew Baggett dad44c8555
Feature/break up monolithic build (#5)
* Supress warning.

* Letsencrypt.

* Break up monolithic build.

* Bump flavours.

* Bump everything [skip ci]
2021-05-30 16:01:23 +02:00

80 lines
2.2 KiB
YAML

name: Build PHP Flavours
on:
push:
paths:
- php/php+apache
- php/php+cli
- php/php+nginx
- php/Dockerfile.Flavours
workflow_run:
workflows:
- Build PHP Core
types:
- completed
jobs:
php-build-flavours:
name: "Build PHP Flavours"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
variant:
- cli
- nginx
- apache
version:
#- "7.0"
#- "7.1"
#- "7.2"
- "7.3"
- "7.4"
- "8.0"
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@v1
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
name: Login to Docker Hub
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: docker/build-push-action@v2
name: Build & Push
with:
context: php
file: php/Dockerfile.Flavours
target: php-${{ matrix.variant }}
platforms: linux/amd64,linux/arm64
pull: true
push: true
tags: |
benzine/php:${{ matrix.variant }}-${{ matrix.version }}
build-args: |
${{ steps.build_args.outputs.result }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache