Skip to content

build Swoole 5.1.2 images #100

build Swoole 5.1.2 images

build Swoole 5.1.2 images #100

name: Build Versioned Alpine Images
on:
push:
branches:
- '[4-9].[0-9]+.[0-9]+'
- '[4-9].[0-9]+.[0-9]+-?[a-zA-Z]**'
jobs:
build_versioned_alpine_images:
runs-on: ubuntu-22.04
if: github.repository == 'swoole/docker-swoole'
strategy:
fail-fast: true
matrix:
php: ["8.0", "8.1", "8.2", "8.3"]
name: The Alpine image for PHP ${{ matrix.php }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set output parameters
id: params
run: |
set -ex
branch_name=${GITHUB_REF##*/}
echo "branch_name=${branch_name}" >> $GITHUB_OUTPUT
if egrep -q '^status\:\s*"under development"\s*($|\#)' "$(pwd)/config/${branch_name}.yml" ; then
major_version=${branch_name%.*}
echo "major_version=${major_version}" >> $GITHUB_OUTPUT
if [ ${{ matrix.php }} == '8.2' ] ; then
if [ ${major_version} == '5.1' ] ; then
echo "image_type=latest" >> $GITHUB_OUTPUT
else
echo "image_type=major" >> $GITHUB_OUTPUT
fi
else
echo "image_type=default" >> $GITHUB_OUTPUT
fi
else
echo "released_already=true" >> $GITHUB_OUTPUT
fi
-
name: Build and push Docker image phpswoole/swoole:${{ steps.params.outputs.branch_name }}-php${{ matrix.php }}-alpine (${{ steps.params.outputs.image_type }})
if: steps.params.outputs.released_already != 'true' && steps.params.outputs.image_type == 'latest'
uses: docker/build-push-action@v5
with:
context: .
file: dockerfiles/${{ steps.params.outputs.branch_name }}/php${{ matrix.php }}/alpine/Dockerfile
platforms: linux/amd64,linux/arm64/v8,linux/ppc64le
push: true
tags: |
phpswoole/swoole:${{ steps.params.outputs.branch_name }}-php${{ matrix.php }}-alpine
phpswoole/swoole:${{ steps.params.outputs.major_version }}-php${{ matrix.php }}-alpine
phpswoole/swoole:${{ steps.params.outputs.major_version }}-alpine
phpswoole/swoole:latest-alpine
-
name: Build and push Docker image phpswoole/swoole:${{ steps.params.outputs.branch_name }}-php${{ matrix.php }}-alpine (${{ steps.params.outputs.image_type }})
if: steps.params.outputs.released_already != 'true' && steps.params.outputs.image_type == 'major'
uses: docker/build-push-action@v5
with:
context: .
file: dockerfiles/${{ steps.params.outputs.branch_name }}/php${{ matrix.php }}/alpine/Dockerfile
platforms: linux/amd64,linux/arm64/v8,linux/ppc64le
push: true
tags: |
phpswoole/swoole:${{ steps.params.outputs.branch_name }}-php${{ matrix.php }}-alpine
phpswoole/swoole:${{ steps.params.outputs.major_version }}-php${{ matrix.php }}-alpine
phpswoole/swoole:${{ steps.params.outputs.major_version }}-alpine
-
name: Build and push Docker image phpswoole/swoole:${{ steps.params.outputs.branch_name }}-php${{ matrix.php }}-alpine (${{ steps.params.outputs.image_type }})
if: steps.params.outputs.released_already != 'true' && steps.params.outputs.image_type == 'default'
uses: docker/build-push-action@v5
with:
context: .
file: dockerfiles/${{ steps.params.outputs.branch_name }}/php${{ matrix.php }}/alpine/Dockerfile
platforms: linux/amd64,linux/arm64/v8,linux/ppc64le
push: true
tags: |
phpswoole/swoole:${{ steps.params.outputs.branch_name }}-php${{ matrix.php }}-alpine
phpswoole/swoole:${{ steps.params.outputs.major_version }}-php${{ matrix.php }}-alpine