mirror of
https://github.com/chialab/docker-php.git
synced 2026-08-24 10:13:24 -05:00
103 lines
3.4 KiB
YAML
103 lines
3.4 KiB
YAML
name: Publish PHP 5 images
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["Test PHP 5 images"]
|
|
branches: [main]
|
|
types: [completed]
|
|
|
|
jobs:
|
|
publish-5:
|
|
name: Build and publish PHP 5 images
|
|
runs-on: ubuntu-22.04
|
|
if: ${{ github.event_name != 'pull_request' && !contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]') }}
|
|
strategy:
|
|
matrix:
|
|
version: [ '5.6' ]
|
|
flavor: [ '', '-apache', '-fpm', '-alpine', '-fpm-alpine' ]
|
|
include:
|
|
- version: 'latest'
|
|
flavor: ''
|
|
- version: 'alpine'
|
|
flavor: ''
|
|
exclude:
|
|
- version: '5.6'
|
|
flavor: '-alpine'
|
|
- version: '5.6'
|
|
flavor: '-fpm-alpine'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
run: |
|
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver-opts: network=host
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_PULL_USER_3 }}
|
|
password: ${{ secrets.DOCKER_PULL_PASS_3 }}
|
|
|
|
- name: Pull base image
|
|
run: |
|
|
docker pull php:${{ matrix.version }}${{ matrix.flavor }}
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build image and push to registry
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
platforms: linux/amd64,linux/arm64
|
|
cache-from: type=registry,ref=chialab/php:${{ matrix.version }}${{ matrix.flavor }}
|
|
cache-to: type=inline
|
|
context: .
|
|
file: ${{ ((contains(matrix.flavor, 'alpine') || matrix.version == 'alpine') && 'Dockerfile.alpine') || 'Dockerfile' }}
|
|
build-args: |
|
|
BASE_IMAGE=php:${{ matrix.version }}${{ matrix.flavor }}
|
|
tags: |
|
|
chialab/php:${{ matrix.version }}${{ matrix.flavor }}
|
|
ghcr.io/chialab/php:${{ matrix.version }}${{ matrix.flavor }}
|
|
push: true
|
|
|
|
- name: Build dev image and push to registry
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
platforms: linux/amd64,linux/arm64
|
|
cache-to: type=inline
|
|
context: ./dev
|
|
build-args: |
|
|
BASE_IMAGE=ghcr.io/chialab/php:${{ matrix.version }}${{ matrix.flavor }}
|
|
tags: |
|
|
chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }}
|
|
ghcr.io/chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }}
|
|
push: true
|
|
|
|
- name: Build xhprof image (amd64 only) and push to registry
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
cache-to: type=inline
|
|
context: ./xhprof
|
|
build-args: |
|
|
BASE_IMAGE=ghcr.io/chialab/php:${{ matrix.version }}${{ matrix.flavor }}
|
|
tags: |
|
|
chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }}
|
|
ghcr.io/chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }}
|
|
push: true
|