17 - Add custom CI image build with PHP 8.4
This commit is contained in:
parent
334a7ccd70
commit
763fc17041
2 changed files with 62 additions and 0 deletions
22
.forgejo/ci/Dockerfile
Normal file
22
.forgejo/ci/Dockerfile
Normal file
|
|
@ -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
|
||||
40
.forgejo/workflows/ci-image.yml
Normal file
40
.forgejo/workflows/ci-image.yml
Normal file
|
|
@ -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
|
||||
Loading…
Reference in a new issue