Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.1' ] | |
php_version: [ '7.4', '8.0', '8.1' ] | |
include: | |
# WordPress did not publish any 6.x images for PHP 7.3, use the latest 5.9 patch. | |
- wp_version: '5.9' | |
php_version: '7.3' | |
# WordPress did not publish earlier versions of WP for PHP8.2. | |
- wp_version: '6.1.1' | |
php_version: '8.2' | |
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 }} |