diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..de98a20 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: ci + +on: + push: + +jobs: + docker: + strategy: + matrix: + version: [8.1, 8.2, 8.3, 8.4] + variant: [debug, release] + 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: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: iantorres/php:${{ matrix.version }}-${{ matrix.variant }} + build-args: | + PHP_VERSION=${{ matrix.version }} + PHP_VARIANT=${{ matrix.variant }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ed3c6c6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,52 @@ +ARG PHP_VERSION=8.3 +ARG PHP_VARIANT=debug + +FROM php:${PHP_VERSION}-alpine + +# Adds install-php-extensions +ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ + +ENV PHP_DEV_EXTENSIONS="xdebug pcov" \ + PHP_MASTER_EXTENSIONS="\ + ev \ + gd \ + pdo \ + pdo_mysql \ + pdo_pgsql \ + zip \ + csv \ + soap \ + brotli \ + intl \ + geospatial \ + geos \ + bcmath \ + bitset \ + calendar \ + mbstring \ + mcrypt \ + mysqli \ + mongodb \ + pgsql \ + xsl \ + gmp \ + sockets \ + ftp \ + ssh2 \ + uuid \ + curl \ + redis \ + exif \ + bz2 \ + pcntl \ + opcache \ + yaml" + +# Adds php extensions +RUN if [ "$PHP_VARIANT" = "debug" ]; then \ + install-php-extensions $PHP_MASTER_EXTENSIONS $PHP_DEV_EXTENSIONS; \ + else \ + install-php-extensions $PHP_MASTER_EXTENSIONS; \ + fi \ + && apk add nodejs-current npm \ + && npm install -g yarn