Skip to content

Merge pull request #71 from brettt89/update-php #16

Merge pull request #71 from brettt89/update-php

Merge pull request #71 from brettt89/update-php #16

Workflow file for this run

name: Release
on:
schedule:
# Run on scheduled every Monday at 2.00am
- cron: '0 2 * * 1'
push:
# Pattern matched against refs/tags
tags:
- '*' # Push events to every tag not containing /
env:
IMAGE_PREFIX: brettt89/silverstripe-web
CACHE_PATH: /tmp/.buildx-cache
jobs:
release:
name: Release
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [bookworm, bullseye, alpine]
php: ['8.1', '8.2', '8.3']
distro: [apache, fpm, cli]
exclude:
- os: alpine
distro: apache
include:
- os: bookworm
additional_distro: true
- os: bookworm
distro: apache
additional_php: true
- os: bookworm
php: 8.3
distro: apache
latest: true
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.IMAGE_PREFIX }}
tags: |
type=raw,value=${{ matrix.php }}-${{ matrix.distro }}-${{ matrix.os }}
type=raw,value=${{ matrix.php }}-${{ matrix.distro }},enable=${{ matrix.additional_distro || false }}
type=raw,value=${{ matrix.php }},enable=${{ matrix.additional_php || false }}
type=raw,value=latest,enable=${{ matrix.latest || false }}
type=raw,value=${{ matrix.php }}-${{ matrix.distro }}-${{ matrix.os }}-{{date 'YYYYMMDD'}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: src/${{ matrix.php }}/${{ matrix.distro }}/${{ matrix.os }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.php }}-${{ matrix.distro }}-${{ matrix.os }}
cache-to: type=gha,scope=${{ matrix.php }}-${{ matrix.distro }}-${{ matrix.os }}