Skip to content

Update PHP

Update PHP #104

Workflow file for this run

name: Release
on:
push:
branches:
- master
jobs:
generate-jobs:
name: Generate Jobs
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.generate-jobs.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: generate-jobs
name: Generate Jobs
run: |
matrix=$(./.github/workflows/generate.sh)
jq . <<<"$matrix" # sanity check / debugging aid
echo "matrix=$matrix" >> $GITHUB_OUTPUT
release:
name: Release image
needs: generate-jobs
runs-on: ubuntu-22.04
continue-on-error: ${{ matrix.experimental == 'true' }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-jobs.outputs.matrix) }}
env:
DOCKER_IMAGE: ghcr.io/oanhnn/php
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKER_IMAGE }}
oanhnn/php
tags: |
type=raw,value=${{ matrix.php }}-${{ matrix.variant }}
labels: |
org.opencontainers.image.title=The PHP Docker Image
org.opencontainers.image.description=The PHP Docker Image base from PHP official images and installed some useful PHP extensions
org.opencontainers.image.author=oanhnn
- name: Setting up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Setting up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: build
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=registry,ref=${{ env.DOCKER_IMAGE }}:buildcache-${{ matrix.php }}-${{ matrix.variant }}
cache-to: type=registry,ref=${{ env.DOCKER_IMAGE }}:buildcache-${{ matrix.php }}-${{ matrix.variant }},mode=max
context: ${{ matrix.php }}/${{ matrix.variant }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: |
linux/amd64
linux/arm64
linux/arm/v7
linux/arm/v6
pull: true
push: true
- name: Image digest
run: echo ${{ steps.build.outputs.digest }}