From b386fbb1c6ef5b9b09ec06e9e01f8ad864905e43 Mon Sep 17 00:00:00 2001 From: Jonathan Lelievre Date: Tue, 8 Aug 2023 19:28:43 +0200 Subject: [PATCH] Splut publish workflow into sub jobs for each version to avoid disk limit --- .github/workflows/publish.yml | 22 ++++++++++++++++++++-- get_json_versions.py | 10 ++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100755 get_json_versions.py diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 683b6c1d..c3ade311 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,8 +8,26 @@ on: - master jobs: + get_versions: + name: Get PrestaShop versions to build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - id: set-versions + run: echo "::set-output name=versions::$(./get_json_versions.py)" + outputs: + versions: ${{ steps.set-versions.outputs.versions }} + publish: runs-on: ubuntu-latest + needs: get_versions + strategy: + matrix: + ps-version: ${{ fromJson(needs.get_versions.outputs.versions) }} steps: - name: Login to Docker Hub uses: docker/login-action@v2 @@ -42,8 +60,8 @@ jobs: run: pip install -r requirements.txt - name: Build Docker images - run: ./prestashop_docker.py --quiet tag build + run: ./prestashop_docker.py --quiet tag build ${{ matrix.ps-version }} - name: Push Docker images if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - run: ./prestashop_docker.py --quiet tag push + run: ./prestashop_docker.py --quiet tag push ${{ matrix.ps-version }} diff --git a/get_json_versions.py b/get_json_versions.py new file mode 100755 index 00000000..db3abbb1 --- /dev/null +++ b/get_json_versions.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python + +import json +from versions import VERSIONS + +jsonVersions = [] +for ps_version, php_versions in VERSIONS.items(): + jsonVersions.append(ps_version) + +print(json.dumps(jsonVersions))