Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PHP Vanilla

PHP Vanilla #40

Workflow file for this run

name: PHP Vanilla
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * 2'
jobs:
build_images:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include:
- php_version: '8.4'
is_latest: true
- php_version: '8.3'
is_latest: false
- php_version: '8.2'
is_latest: false
- php_version: '8.1'
is_latest: false
- php_version: '8.0'
is_latest: false
- php_version: '7.4'
is_latest: false
- php_version: '7.3'
is_latest: false
- php_version: '7.2'
is_latest: false
- php_version: '7.1'
is_latest: false
- php_version: '7.0'
is_latest: false
- php_version: '5.6'
is_latest: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# BUILD AMD64 IMAGE
- name: Build PHP Base Image - amd64
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
context: .
file: flavors/vanilla/Dockerfile
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
PHP_VERSION=${{ matrix.php_version }}
tags: |
fbraz3/php-apache2:${{ matrix.php_version }}-amd64
- name: Test images - amd64
run: |
docker run --name test -v $PWD:/app/public -p 80:80 -it --rm -d --platform=linux/amd64 fbraz3/php-apache2:${{ matrix.php_version }}-amd64
sleep 60
echo "-----------"
docker logs test
docker exec -i test ps faux
echo "-----------"
docker exec -i test ps faux |grep -q "apache2" || exit 1
curl http://127.0.0.1/ | grep -q "Hello World" || exit 1
docker exec -i test monit summary || exit 1
docker stop test
env:
PHP_VERSION: ${{ matrix.php_version }}
# BUILD ARM64 IMAGE
- name: Build PHP Base Image - arm64
uses: docker/build-push-action@v6
with:
platforms: linux/arm64
context: .
file: flavors/vanilla/Dockerfile
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
PHP_VERSION=${{ matrix.php_version }}
tags: |
fbraz3/php-apache2:${{ matrix.php_version }}-arm64
- name: Test images - arm64
run: |
docker run --name test -v $PWD:/app/public -p 80:80 -it --rm -d --platform=linux/arm64 fbraz3/php-apache2:${{ matrix.php_version }}-arm64
sleep 60
echo "-----------"
docker logs test
docker exec -i test ps faux
echo "-----------"
docker exec -i test ps faux |grep -q "apache2" || exit 1
curl http://127.0.0.1/ | grep -q "Hello World" || exit 1
docker exec -i test monit summary || exit 1
docker stop test
env:
PHP_VERSION: ${{ matrix.php_version }}
# BUILD AND PUSH MULTI-ARCH IMAGE
# Github Actions cache is used to speed up the build process and ensure that the tests are run on the latest image
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push PHP Base Images
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
context: .
file: flavors/vanilla/Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
PHP_VERSION=${{ matrix.php_version }}
tags: |
fbraz3/php-apache2:${{ matrix.php_version }}
fbraz3/php-apache:${{ matrix.php_version }}
fbraz3/php-httpd:${{ matrix.php_version }}
${{ matrix.is_latest && 'fbraz3/php-apache2:latest' || '' }}
${{ matrix.is_latest && 'fbraz3/php-apache:latest' || '' }}
${{ matrix.is_latest && 'fbraz3/php-httpd:latest' || '' }}