Files
docker-php/.github/workflows/publish.compat.yml
T

66 lines
2.1 KiB
YAML

name: Publish compatibility images (amd64 only)
on:
workflow_run:
workflows: ["Test compatibility images"]
branches: [main]
types: [completed]
jobs:
publish-compat:
name: Build and publish compatibility images
runs-on: ubuntu-22.04
if: ${{ github.event.workflow_run.conclusion == 'success' && !contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]') }}
strategy:
matrix:
version: [ '5.6' ]
flavor: [ '', '-apache', '-fpm' ]
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 (pull)
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_PULL_USER_4 }}
password: ${{ secrets.DOCKER_PULL_PASS_4 }}
- name: Pull base image
run: |
docker pull debian:stretch-slim
- name: Login to DockerHub (push)
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
# cache-from: type=registry,ref=ghcr.io/chialab/php-compat:${{ matrix.version }}${{ matrix.flavor }}
cache-to: type=inline
context: ./compat
file: ${{ format('compat/{0}.{1}{2}', 'Dockerfile', matrix.version, matrix.flavor) }}
tags: |
chialab/php-compat:${{ matrix.version }}${{ matrix.flavor }}
ghcr.io/chialab/php-compat:${{ matrix.version }}${{ matrix.flavor }}
push: true