Skip to content

chore(deps): update docker/setup-qemu-action action to v3.7.0 #505

chore(deps): update docker/setup-qemu-action action to v3.7.0

chore(deps): update docker/setup-qemu-action action to v3.7.0 #505

Workflow file for this run

name: Docker Build
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build ${{ matrix.php_version }}-composer${{ matrix.composer_version }}
runs-on: ubuntu-latest
strategy:
matrix:
php_version: ["8.1", "8.2", "8.3", "8.4"]
composer_version: ["2"]
platforms: ["linux/amd64,linux/arm64/v8"]
include:
- php_version: "8.4"
latest: "true"
env:
TEST_TAG: ${{ github.repository }}:test
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Docker meta (base)
id: meta-base
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: |
clevyr/php
ghcr.io/clevyr/php
flavor: latest=false
tags: |
# {{major}}.{{minor}}-composer{{major}}-base
type=semver,pattern={{major}}.{{minor}},suffix=-composer${{ matrix.composer_version }}-base,value=${{ matrix.php_version }}.0
# {{major}}.{{minor}}-base
type=semver,enable=${{ matrix.composer_version == '2' }},pattern={{major}}.{{minor}},suffix=-base,value=${{ matrix.php_version }}.0
# {{major}}-base
type=semver,enable=${{ matrix.composer_version == '2' && (matrix.latest_major == 'true' || matrix.latest == 'true') }},pattern={{major}},suffix=-base,value=${{ matrix.php_version }}.0
- name: Docker meta (onbuild)
id: meta-onbuild
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: |
clevyr/php
ghcr.io/clevyr/php
flavor: latest=false
tags: |
# latest
type=raw,enable=${{ matrix.latest == 'true' }},value=latest
# {{major}}.{{minor}}-composer{{major}}-onbuild
type=semver,pattern={{major}}.{{minor}},suffix=-composer${{ matrix.composer_version }}-onbuild,value=${{ matrix.php_version }}.0
# {{major}}.{{minor}}-composer{{major}}
type=semver,pattern={{major}}.{{minor}},suffix=-composer${{ matrix.composer_version }},value=${{ matrix.php_version }}.0
# {{major}}.{{minor}}-onbuild
type=semver,enable=${{ matrix.composer_version == '2' }},pattern={{major}}.{{minor}},suffix=-onbuild,value=${{ matrix.php_version }}.0
# {{major}}.{{minor}}
type=semver,enable=${{ matrix.composer_version == '2' }},pattern={{major}}.{{minor}},value=${{ matrix.php_version }}.0
# {{major}}-composer{{major}}
type=semver,enable=${{ (matrix.latest_major == 'true' || matrix.latest == 'true') }},pattern={{major}},suffix=-composer${{ matrix.composer_version }},value=${{ matrix.php_version }}.0
# {{major}}-onbuild
type=semver,enable=${{ matrix.composer_version == '2' && (matrix.latest_major == 'true' || matrix.latest == 'true') }},pattern={{major}},suffix=-onbuild,value=${{ matrix.php_version }}.0
# {{major}}
type=semver,enable=${{ matrix.composer_version == '2' && (matrix.latest_major == 'true' || matrix.latest == 'true') }},pattern={{major}},value=${{ matrix.php_version }}.0
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Login to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
pull: true
load: true
tags: ${{ env.TEST_TAG }}
build-args: |
COMPOSER_VERSION=${{ matrix.composer_version }}
PHP_VERSION=${{ matrix.php_version }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test nginx config
run: docker run --rm -i "$TEST_TAG" nginx -t
- name: Test php-fpm config
run: docker run --rm -i "$TEST_TAG" php-fpm -tt
- name: Test commands exist
run: docker run --rm -i "$TEST_TAG" which composer install-php-extensions clevyr-build
- name: Build and Push (base)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
pull: true
push: ${{ github.ref_name == 'main' }}
platforms: ${{ matrix.platforms }}
tags: ${{ steps.meta-base.outputs.tags }}
labels: ${{ steps.meta-base.outputs.labels }}
build-args: |
COMPOSER_VERSION=${{ matrix.composer_version }}
PHP_VERSION=${{ matrix.php_version }}
target: base
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and Push (onbuild)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
push: ${{ github.ref_name == 'main' }}
platforms: ${{ matrix.platforms }}
tags: ${{ steps.meta-onbuild.outputs.tags }}
labels: ${{ steps.meta-onbuild.outputs.labels }}
build-args: |
COMPOSER_VERSION=${{ matrix.composer_version }}
PHP_VERSION=${{ matrix.php_version }}
target: onbuild
cache-from: type=gha
cache-to: type=gha,mode=max