From 5979851a5066bd7c47f7ad21be768a94f7e29738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Mon, 11 Nov 2024 21:21:18 +0100 Subject: [PATCH] GH actions build --- .editorconfig | 12 +++ .github/workflows/multiarch-build.yaml | 41 ++++++++++ Containerfile | 108 ++++++++++--------------- 3 files changed, 97 insertions(+), 64 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/multiarch-build.yaml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f84a790 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_style = space +indent_size = 2 diff --git a/.github/workflows/multiarch-build.yaml b/.github/workflows/multiarch-build.yaml new file mode 100644 index 0000000..dbdef2c --- /dev/null +++ b/.github/workflows/multiarch-build.yaml @@ -0,0 +1,41 @@ +name: Multiarch build + +on: + push: + branches: + - '**' + schedule: + # Every month's 2nd on 5:30 + - cron: '30 5 2 * *' + +jobs: + multiarch-build: + name: Build images + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Install qemu dependency + run: | + sudo apt-get update + sudo apt-get install -y qemu-user-static + + - name: Buildah Action + id: build-image + uses: redhat-actions/buildah-build@v2 + with: + image: php + tags: latest + platforms: linux/amd64, linux/arm64 + containerfiles: Containerfile + + - name: Push To quay.io + id: push-to-quay + uses: redhat-actions/push-to-registry@v2 + if: github.ref == 'refs/heads/master' + with: + image: ${{ steps.build-image.outputs.image }} + tags: ${{ steps.build-image.outputs.tags }} + registry: quay.io/wavesoftware + username: ${{ secrets.QUAY_USER }} + password: ${{ secrets.QUAY_PASSWORD }} diff --git a/Containerfile b/Containerfile index 4835483..09d8200 100644 --- a/Containerfile +++ b/Containerfile @@ -1,66 +1,46 @@ FROM docker.io/library/php:8-fpm -RUN apt-get update && apt-get install -y \ - libcurl4-openssl-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libxml2-dev \ - libfreetype6-dev \ - libjpeg62-turbo-dev \ - libmcrypt-dev \ - libpng-dev \ - libmemcached-dev \ - libpq-dev \ - libzip-dev \ - libgmp-dev \ - rsync \ - bzip2 \ - busybox-static \ - libmagickwand-dev \ - imagemagick -RUN docker-php-ext-configure gd \ - --with-freetype \ - --with-jpeg -RUN docker-php-ext-configure ldap --with-libdir="lib/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" -RUN docker-php-ext-install \ - iconv \ - mysqli \ - exif \ - gd \ - intl \ - ldap \ - opcache \ - pcntl \ - pdo_mysql \ - pdo_pgsql \ - zip \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - gettext \ - bcmath \ - sysvsem \ - gmp -RUN yes '' | pecl install imagick -RUN yes '' | pecl install apcu -RUN yes '' | pecl install memcached -RUN yes '' | pecl install redis -RUN yes '' | pecl install mcrypt -RUN docker-php-ext-enable \ - apcu \ - memcached \ - redis \ - mcrypt \ - imagick +RUN apt-get update && apt-get upgrade -y && apt-get autoclean + +ADD --chmod=0755 \ + https://github.com/mlocati/docker-php-extension-installer/releases/download/2.6.3/install-php-extensions \ + /usr/local/bin/ + +RUN install-php-extensions \ + apcu \ + bcmath \ + curl \ + exif \ + filter \ + gd \ + gettext \ + gmp \ + iconv \ + # TODO: Use latest released version, after https://github.com/Imagick/imagick/issues/640 is fixed + imagick/imagick@28f27044e435a2b203e32675e942eb8de620ee58 \ + intl \ + ldap \ + mbstring \ + mcrypt \ + memcached \ + mysqli \ + opcache \ + pcntl \ + pdo \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + redis \ + sysvsem \ + zip + RUN { \ - echo 'opcache.enable=1'; \ - echo 'opcache.enable_cli=1'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=10000'; \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.revalidate_freq=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini && \ - echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini && \ - echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini + echo 'opcache.enable=1'; \ + echo 'opcache.enable_cli=1'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=10000'; \ + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.save_comments=1'; \ + echo 'opcache.revalidate_freq=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini && \ + echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini && \ + echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini