Skip to content

Docker PHP Images GitHub workflow #245

Docker PHP Images GitHub workflow

Docker PHP Images GitHub workflow #245

Workflow file for this run

name: Docker PHP Images GitHub workflow
on:
pull_request:
branches:
- 'v6'
- 'v7'
push:
branches:
- 'v6'
- 'v7'
schedule:
- cron: '42 3 * * 0'
workflow_dispatch:
jobs:
build_test_maybe_release:
name: 'Build & test'
strategy:
matrix:
php_version: ['8.1', '8.2', '8.3']
platform: ['linux/amd64', 'linux/arm64']
variant: ['apache', 'cli', 'fpm']
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout
uses: actions/checkout@v4
- name: Build and test
run: |
PHP_VERSION="${{ matrix.php_version }}" BRANCH="${{ github.ref_name }}" VARIANT="${{ matrix.variant }}" OWNER="${{ secrets.DOCKERHUB_USERNAME }}" PLATFORM="${{ matrix.platform }}" ./build-and-test.sh
docker images | grep ${OWNER}/php
- name: Login to DockerHub
# Merge ~ push.
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Release
# Merge ~ push.
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
run: |
PHP_VERSION="${{ matrix.php_version }}" BRANCH="${{ github.ref_name }}" VARIANT="${{ matrix.variant }}" OWNER="${{ secrets.DOCKERHUB_USERNAME }}" PLATFORM="${{ matrix.platform }}" ./push.sh
combine_archs:
name: 'Combine & release'
# Merge ~ push.
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
needs: [ build_test_maybe_release ]
strategy:
matrix:
php_version: ['8.1', '8.2', '8.3']
variant: ['apache', 'cli', 'fpm']
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create combined Manifest
run: PHP_VERSION="${{ matrix.php_version }}" BRANCH="${{ github.ref_name }}" VARIANT="${{ matrix.variant }}" OWNER="${{ secrets.DOCKERHUB_USERNAME }}" ./combine_archs.sh