-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (79 loc) · 2.56 KB
/
build-prestashop.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
87
88
89
90
91
92
name: 'Build prestashop images'
on:
workflow_dispatch:
permissions:
contents: read
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
prepare:
runs-on: ubuntu-22.04
outputs:
ps7-matrix: ${{ steps.ps.outputs.ps7-matrix }}
ps8-matrix: ${{ steps.ps.outputs.ps8-matrix }}
steps:
- name: 'Get all PrestaShop versions as json array'
id: ps
#language=bash
run: |
# PrestaShop versions without beta, rc, etc.
result=$(curl -s https://api.github.com/repos/PrestaShop/PrestaShop/tags)
versions=$(echo "$result" | jq -c '.[].name' | grep -v -E 'beta|rc|alpha|dev' | jq -sc 'unique | reverse')
ps7_versions=$(echo "$versions" | jq -c 'map(select(. | startswith("1.7")))')
ps8_versions=$(echo "$versions" | jq -c 'map(select(. | startswith("8")))')
echo "ps7-matrix=$ps7_versions" >> $GITHUB_OUTPUT
echo "ps8-matrix=$ps8_versions" >> $GITHUB_OUTPUT
build-ps7:
runs-on: ubuntu-22.04
needs: prepare
strategy:
fail-fast: false
matrix:
php: ['7.4', '7.1']
ps: ${{ fromJson(needs.prepare.outputs.ps7-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/prestashop
image: myparcelnl/prestashop
suffix: ${{ matrix.ps }}-php${{ matrix.php }}
build-args: |
PHP_VERSION=${{ matrix.php }}
PS_VERSION=${{ matrix.ps }}
build-ps8:
runs-on: ubuntu-22.04
needs: prepare
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.1']
ps: ${{ fromJson(needs.prepare.outputs.ps8-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/prestashop
image: myparcelnl/prestashop
suffix: ${{ matrix.ps }}-php${{ matrix.php }}
build-args: |
PHP_VERSION=${{ matrix.php }}
PS_VERSION=${{ matrix.ps }}
notify-on-failure:
needs:
- build-ps7
- build-ps8
if: always() && contains(needs.*.result, 'failure')
uses: myparcelnl/actions/.github/workflows/notify-on-failure.yml@v4
secrets: inherit