Skip to content
This repository was archived by the owner on Nov 14, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 45 additions & 17 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
name: CI/CD

on: [push, workflow_dispatch]
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
repository_dispatch:
types: [docker-php-updated]

permissions:
contents: read

env:
DOCKER_BUILDKIT: 1

jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
version: ['7.4', '8.0', '8.1', '8.2', '8.3']
runner: [ubuntu-latest, ubuntu-24.04-arm]

steps:
- name: Checkout code
uses: actions/checkout@v3.1.0

- name: Setup QEMU
uses: docker/setup-qemu-action@v2
uses: actions/checkout@v4

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
uses: docker/setup-buildx-action@v3

- name: Build and export to Docker
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: ${{ matrix.version }}
pull: true
load: true
tags: kooldev/phpqa:${{ matrix.version }}

Expand All @@ -46,12 +48,38 @@ jobs:
docker run kooldev/phpqa:${{ matrix.version }} phpcpd --version
docker run kooldev/phpqa:${{ matrix.version }} php-cs-fixer --version
docker run kooldev/phpqa:${{ matrix.version }} local-php-security-checker -help
docker run kooldev/phpqa:${{ matrix.version }} phpstan --version
docker run kooldev/phpqa:${{ matrix.version }} phpcs --version

publish:
needs: build
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa'
runs-on: ubuntu-latest
strategy:
matrix:
version: ['7.4', '8.0', '8.1', '8.2', '8.3']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v3
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa'
uses: docker/build-push-action@v6
with:
context: ${{ matrix.version }}
pull: true
platforms: linux/amd64,linux/arm64
push: true
tags: kooldev/phpqa:${{ matrix.version }}
3 changes: 2 additions & 1 deletion 7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
&& rm -rf /var/cache/apk/* /tmp/*

# install QA tools
ARG TARGETARCH
RUN \
# install and set up QA tools from Composer
composer global require squizlabs/php_codesniffer \
Expand All @@ -21,7 +22,7 @@ RUN \
# download PHAR and make them executable
&& mkdir /phars \
&& curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \
&& curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \
&& curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \
&& curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \
&& curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \
&& chmod +x /phars/* \
Expand Down
3 changes: 2 additions & 1 deletion 8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
&& rm -rf /var/cache/apk/* /tmp/*

# install QA tools
ARG TARGETARCH
RUN \
# install and set up QA tools from Composer
composer global require squizlabs/php_codesniffer \
Expand All @@ -21,7 +22,7 @@ RUN \
# download PHAR and make them executable
&& mkdir /phars \
&& curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \
&& curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \
&& curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \
&& curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \
&& curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \
&& chmod +x /phars/* \
Expand Down
3 changes: 2 additions & 1 deletion 8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
&& rm -rf /var/cache/apk/* /tmp/*

# install QA tools
ARG TARGETARCH
RUN \
# install and set up QA tools from Composer
composer global require squizlabs/php_codesniffer \
Expand All @@ -21,7 +22,7 @@ RUN \
# download PHAR and make them executable
&& mkdir /phars \
&& curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \
&& curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \
&& curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \
&& curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \
&& curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \
&& chmod +x /phars/* \
Expand Down
3 changes: 2 additions & 1 deletion 8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
&& rm -rf /var/cache/apk/* /tmp/*

# install QA tools
ARG TARGETARCH
RUN \
# install and set up QA tools from Composer
composer global require squizlabs/php_codesniffer \
Expand All @@ -21,7 +22,7 @@ RUN \
# download PHAR and make them executable
&& mkdir /phars \
&& curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \
&& curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \
&& curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \
&& curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \
&& curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \
&& chmod +x /phars/* \
Expand Down
3 changes: 2 additions & 1 deletion 8.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
&& rm -rf /var/cache/apk/* /tmp/*

# install QA tools
ARG TARGETARCH
RUN \
# install and set up QA tools from Composer
composer global require squizlabs/php_codesniffer \
Expand All @@ -21,7 +22,7 @@ RUN \
# download PHAR and make them executable
&& mkdir /phars \
&& curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \
&& curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \
&& curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \
&& curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \
&& curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \
&& chmod +x /phars/* \
Expand Down
3 changes: 2 additions & 1 deletion template/Dockerfile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
&& rm -rf /var/cache/apk/* /tmp/*

# install QA tools
ARG TARGETARCH
RUN \
# install and set up QA tools from Composer
composer global require squizlabs/php_codesniffer \
Expand All @@ -21,7 +22,7 @@
# download PHAR and make them executable
&& mkdir /phars \
&& curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \
&& curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \
&& curl -Lf "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_${TARGETARCH}" -o /phars/local-php-security-checker \
&& curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \
&& curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \
&& chmod +x /phars/* \
Expand Down
Loading