Skip to content

Build wordpress images #17

Build wordpress images

Build wordpress images #17

name: 'Build wordpress images'
on:
push:
branches:
- main
paths:
- images/wordpress/**/*
workflow_dispatch:
permissions:
contents: read
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
prepare-php:
uses: ./.github/workflows/--prepare-php.yml
secrets: inherit
with:
min-version: '8.2'
prepare-wp:
runs-on: ubuntu-22.04
outputs:
wp-matrix: ${{ steps.wp.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- name: 'Get all WordPress versions as json array'
id: wp
#language=bash
run: |
result=$(curl -s https://api.wordpress.org/core/version-check/1.7/)
versions=$(echo "$result" | jq -rc '[.offers[].version] | unique | reverse')
echo "matrix=$versions" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-22.04
needs:
- prepare-wp
strategy:
fail-fast: false
matrix:
php: [ '8.2', '7.4' ]
wp: ${{ fromJson(needs.prepare-wp.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/login-ghcr
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/build-push
with:
registry: ghcr.io
cache-mode: 'min'
context: images/wordpress
image: myparcelnl/wordpress
suffix: ${{ matrix.wp }}-php${{ matrix.php }}
build-args: |
PHP_VERSION=${{ matrix.php }}
WP_VERSION=${{ matrix.wp }}