Skip to content

Build PHP docker images #152

Build PHP docker images

Build PHP docker images #152

Workflow file for this run

name: Build PHP docker images
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 12 * * SUN' # every sunday
workflow_dispatch:
jobs:
build:
name: PHP
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
php_version:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
id: setup-buildx
uses: docker/setup-buildx-action@v2
with:
platforms: |
linux/amd64
linux/arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: lephare/php
tags: |
type=raw,${{ matrix.php_version }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:${{ matrix.php_version }}"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ steps.setup-buildx.outputs.platforms }}
cache-from: type=gha
cache-to: type=gha,mode=max