-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (70 loc) · 2.1 KB
/
build-wordpress.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- name: 'Get all WordPress versions as json array'
id: wp
#language=bash
run: |
versions=$(curl -s https://api.wordpress.org/core/version-check/1.7/ | jq -r '[.offers[].version] | unique | .[]')
echo "versions=$versions" >> $GITHUB_OUTPUT
- uses: ./.github/actions/create-matrix
id: wp-matrix
with:
versions: ${{ steps.wp.outputs.versions }}
build:
runs-on: ubuntu-22.04
needs:
- prepare-php
- prepare-wp
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.prepare-php.outputs.matrix) }}
wp: ${{ fromJson(needs.prepare-wp.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/login-ghcr
with:
token: ${{ secrets.GITHUB_TOKEN }}
- run: |
echo ${{ toJson(matrix) }}
echo ${{ toJson(matrix.php) }}
echo ${{ toJson(matrix.wp) }}
echo ${{ matrix }}
echo ${{ matrix.php }}
echo ${{ matrix.wp }}
echo ${{ matrix.php.version }}
echo ${{ matrix.wp.version }}
# - uses: ./.github/actions/build-push
# with:
# registry: ghcr.io
# cache-mode: 'min'
# context: images/wordpress
# image: myparcelnl/wordpress
# suffix: ${{ matrix.wp }}-php${{ matrix.php }}
# latest: ${{ matrix.wp == needs.prepare.outputs.wp-latest && matrix.php == '8.2' }}
# build-args: |
# PHP_VERSION=${{ matrix.php }}
# WP_VERSION=${{ matrix.wp }}