Skip to content
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
12 changes: 11 additions & 1 deletion .github/workflows/githubactions-glpi-apache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,21 @@ jobs:
TAGS="${TAGS},ghcr.io/glpi-project/githubactions-glpi-apache:latest"
fi
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- name: "Set base image"
id: base-image
run: |
BASE_IMAGE="ghcr.io/glpi-project/githubactions-php-apache:${{ matrix.php-version }}"
# Use the variant that contains the Playwright system dependencies, to make them available to plugins.
# Skip for PHP 7.4, 8.0 and 8.1 images as they are no longer built so they don't support this tag.
if [[ ! "${{ matrix.php-version }}" =~ ^(7\.4|8\.0|8\.1)$ ]]; then
BASE_IMAGE="${BASE_IMAGE}-playwright"
fi
echo "base-image=${BASE_IMAGE}" >> $GITHUB_OUTPUT
- name: "Build and push"
uses: "docker/build-push-action@v7"
with:
build-args: |
BASE_IMAGE=ghcr.io/glpi-project/githubactions-php-apache:${{ matrix.php-version }}
BASE_IMAGE=${{ steps.base-image.outputs.base-image }}
GLPI_BRANCH=${{ matrix.glpi-branch }}
no-cache: true
context: "githubactions-glpi-apache"
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/githubactions-php-apache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,17 @@ jobs:
context: "githubactions-php-apache"
outputs: "${{ env.OUTPUTS }}"
pull: true
target: "base"
tags: "ghcr.io/glpi-project/githubactions-php-apache:${{ matrix.php-version }}"
- name: "Build and push (Playwright variant)"
uses: "docker/build-push-action@v7"
with:
build-args: |
BASE_IMAGE=${{ matrix.base-image }}
cache-from: "type=gha"
cache-to: "type=gha,mode=max"
context: "githubactions-php-apache"
outputs: "${{ env.OUTPUTS }}"
pull: true
target: "playwright"
tags: "ghcr.io/glpi-project/githubactions-php-apache:${{ matrix.php-version }}-playwright"
27 changes: 23 additions & 4 deletions githubactions-php-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM composer:latest AS composer
#####
# Build main image
#####
FROM $BASE_IMAGE
FROM $BASE_IMAGE AS base

LABEL \
org.opencontainers.image.title="GLPI Github Actions PHP container" \
Expand Down Expand Up @@ -152,9 +152,6 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin
# Install gettext used for translation files.
&& apt install --assume-yes --no-install-recommends --quiet gettext \
\
# Install Playwright dependencies
&& npx playwright install-deps chromium \
\
# Install ldap utils used by plugin CI workflows.
&& apt install --assume-yes --no-install-recommends --quiet ldap-utils \
\
Expand Down Expand Up @@ -210,3 +207,25 @@ WORKDIR /var/www/glpi
# Define GLPI environment variables
ENV \
GLPI_ENVIRONMENT_TYPE=testing

#####
# Variant with Playwright system dependencies
#####
FROM base AS playwright

USER root

RUN \
# Update package list.
apt update \
\
# Install Playwright dependencies
&& npx playwright install-deps chromium \
\
# Clean sources list
&& rm -rf /var/lib/apt/lists/* \
\
# Clean npm cache (created by `npx`, not used later)
&& rm -rf /root/.npm

USER www-data
Loading