Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 42 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- id: set-versions
run: echo "versions=$(ls base/images/ | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
Expand Down Expand Up @@ -50,8 +50,14 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Enable multi-platform builds
run: docker buildx create --name container --driver=docker-container
uses: docker/setup-buildx-action@v3
with:
name: container
version: latest

- uses: actions/checkout@v2

Expand All @@ -75,30 +81,55 @@ jobs:
needs:
- list_prestashop_images
- publish_base
- list_base_images
strategy:
max-parallel: 2
fail-fast: false
matrix:
ps-version: ${{ fromJson(needs.list_prestashop_images.outputs.versions) }}
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
- uses: actions/checkout@v2

- uses: dorny/paths-filter@v3
id: filter
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
filters: |
image_has_changed:
- 'images/${{ matrix.ps-version }}/**'

- name: Set up QEMU
if: ${{ steps.filter.outputs.image_has_changed == 'true' }}
uses: docker/setup-qemu-action@v3

- name: Enable multi-platform builds
run: docker buildx create --name container --driver=docker-container
if: ${{ steps.filter.outputs.image_has_changed == 'true' }}
uses: docker/setup-buildx-action@v3
with:
name: container
version: latest

- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python
if: ${{ steps.filter.outputs.image_has_changed == 'true' }}
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
if: ${{ steps.filter.outputs.image_has_changed == 'true' }}
run: pip install -r requirements.txt

- name: Build & Push Docker images
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
- name: Build Docker images
if: ${{ steps.filter.outputs.image_has_changed == 'true' }}
run: DOCKER_REPOSITORY=${{ vars.DOCKER_REPOSITORY}} ./prestashop_docker.py --quiet tag build ${{ matrix.ps-version }} --force

- name: Login to Docker Hub
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && (needs.list_base_images.outputs.base_has_changed == 'true' || steps.filter.outputs.image_has_changed == 'true') }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build by using cache and push Docker images
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && (needs.list_base_images.outputs.base_has_changed == 'true' || steps.filter.outputs.image_has_changed == 'true') }}
run: DOCKER_REPOSITORY=${{ vars.DOCKER_REPOSITORY}} ./prestashop_docker.py --quiet tag push ${{ matrix.ps-version }} --force

1 change: 1 addition & 0 deletions prestashop_docker/tag_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def build(self, version=None, force=False, push=False):
"docker", "buildx", "build",
"--platform", "linux/arm/v7,linux/arm64/v8,linux/amd64",
"--builder", "container",
"--progress", "plain",
] + tags + args + [
str(version_path)
]
Expand Down