Skip to content

Build prestashop images #10

Build prestashop images

Build prestashop images #10

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