Skip to content

Commit

Permalink
Splut publish workflow into sub jobs for each version to avoid disk l…
Browse files Browse the repository at this point in the history
…imit
  • Loading branch information
jolelievre committed Aug 8, 2023
1 parent 5d36036 commit b386fbb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
10 changes: 10 additions & 0 deletions get_json_versions.py
Original file line number Diff line number Diff line change
@@ -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))

0 comments on commit b386fbb

Please sign in to comment.