Skip to content

Merge pull request #170 from stellarwp/1.5.0 #79

Merge pull request #170 from stellarwp/1.5.0

Merge pull request #170 from stellarwp/1.5.0 #79

name: Publish slic-wordpress-php Docker image
on:
push:
branches:
- main
- '[0-9]+.[0-9]+.[0-9]+'
release:
types: [published]
jobs:
publish-wordpress-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
wp_version: [ '6.2' ]
php_version: [ '8.0', '8.1', '8.2' ]
include:
# No WordPress image for version 6.2+ and PHP 7.3: use the latest 5.9 version.
# This version is NOT udpated in the containers/wordpress/Dockerfile for back-compatibility.
- wp_version: '5.9'
php_version: '7.3'
# No WordPress image for version 6.2+ and PHP 7.4: use the latest 6.1.1 version.
# See containers/wordpress/Dockerfile for the wp-cli update to version 6.2.
- wp_version: '6.1.1'
php_version: '7.4'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ghcr.io/${{ github.repository }}-wordpress-php${{ matrix.php_version }}
tags: |
type=edge,branch=main
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{raw}}
- uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/[email protected]
continue-on-error: true
with:
context: containers/wordpress
file: containers/wordpress/Dockerfile
push: true
pull: true
tags: |
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.wp_version }}-${{ matrix.php_version }}
cache-to: type=gha,mode=max,scope=${{ matrix.wp_version }}-${{ matrix.php_version }}
build-args: |
PHP_VERSION=${{ matrix.php_version }}
WP_VERSION=${{ matrix.wp_version }}