-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.73 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
name: 'Build wordpress images'
on:
workflow_dispatch:
permissions:
contents: read
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
prepare-wp:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.wp.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- 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')
latest=$(echo "$result" | jq -rc '[.offers[].version][0]')
echo "matrix=$versions" >> $GITHUB_OUTPUT
echo "latest=$latest" >> $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@v4
- 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
latest: ${{ matrix.wp }} == ${{needs.prepare-wp.outputs.latest}} && ${{ matrix.php }} == '8.2'
suffix: ${{ matrix.wp }}-php${{ matrix.php }}
build-args: |
PHP_VERSION=${{ matrix.php }}
WP_VERSION=${{ matrix.wp }}
notify-on-failure:
needs:
- build
if: always() && contains(needs.*.result, 'failure')
uses: myparcelnl/actions/.github/workflows/notify-on-failure.yml@v4
secrets: inherit