From 763fc170413ef7330ac902d9cf808c562d10ada9 Mon Sep 17 00:00:00 2001 From: myrmidex Date: Wed, 10 Jun 2026 21:56:25 +0000 Subject: [PATCH] 17 - Add custom CI image build with PHP 8.4 --- .forgejo/ci/Dockerfile | 22 ++++++++++++++++++ .forgejo/workflows/ci-image.yml | 40 +++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .forgejo/ci/Dockerfile create mode 100644 .forgejo/workflows/ci-image.yml diff --git a/.forgejo/ci/Dockerfile b/.forgejo/ci/Dockerfile new file mode 100644 index 0000000..e33b8df --- /dev/null +++ b/.forgejo/ci/Dockerfile @@ -0,0 +1,22 @@ +# CI image: catthehacker/ubuntu:act-latest + PHP 8.4 + extensions + Composer +# Used by .forgejo/workflows/ci.yml — built/pushed by .forgejo/workflows/ci-image.yml +FROM catthehacker/ubuntu:act-latest + +ENV DEBIAN_FRONTEND=noninteractive + +RUN add-apt-repository -y ppa:ondrej/php \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + php8.4-cli \ + php8.4-pgsql \ + php8.4-mbstring \ + php8.4-xml \ + php8.4-dom \ + php8.4-intl \ + php8.4-pcov \ + && update-alternatives --set php /usr/bin/php8.4 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Composer (latest 2.x, static binary from official image) +COPY --from=composer:2 /usr/bin/composer /usr/bin/composer diff --git a/.forgejo/workflows/ci-image.yml b/.forgejo/workflows/ci-image.yml new file mode 100644 index 0000000..bbf318d --- /dev/null +++ b/.forgejo/workflows/ci-image.yml @@ -0,0 +1,40 @@ +name: Build CI Image + +on: + push: + branches: [main] + paths: + - '.forgejo/ci/Dockerfile' + - '.forgejo/workflows/ci-image.yml' + pull_request: + paths: + - '.forgejo/ci/Dockerfile' + - '.forgejo/workflows/ci-image.yml' + +jobs: + build: + runs-on: docker + container: + image: catthehacker/ubuntu:act-latest + + steps: + - uses: https://data.forgejo.org/actions/checkout@v4 + + - name: Set up Docker Buildx + uses: https://data.forgejo.org/docker/setup-buildx-action@v3 + + - name: Login to Forgejo Registry + uses: https://data.forgejo.org/docker/login-action@v3 + with: + registry: forge.lvl0.xyz + username: ${{ github.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push + uses: https://data.forgejo.org/docker/build-push-action@v5 + with: + context: .forgejo/ci + file: .forgejo/ci/Dockerfile + platforms: linux/amd64 + push: ${{ github.event_name != 'pull_request' }} + tags: forge.lvl0.xyz/lvl0/rater-ci:latest