Skip to content

Commit 4db4d2e

Browse files
fabriciojsclaude
andcommitted
feat(ci): add multi-arch push jobs with dependency order (US-002)
Add push jobs for master branch that: - Only run on master branch and kool-dev/docker-php repo - Use docker-container driver (default) for multi-arch builds - Push to linux/amd64 and linux/arm64 platforms - Enforce dependency order: base → nginx/node Jobs added: - push-alpine-base (needs: build-test-alpine) - push-alpine-nginx (needs: push-alpine-base) - push-alpine-node (needs: push-alpine-base) - push-debian-base (needs: build-test-debian) - push-debian-nginx (needs: push-debian-base) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b07079a commit 4db4d2e

2 files changed

Lines changed: 409 additions & 0 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,192 @@ jobs:
352352
run: |
353353
docker run kooldev/php:8.4-debian-nginx${{ matrix.type }} php -m | grep -i pcov
354354
docker run -e ENABLE_XDEBUG=true kooldev/php:8.4-debian-nginx${{ matrix.type }} php -m | grep -i xdebug
355+
356+
# ===========================================
357+
# PUSH JOBS (master branch only)
358+
# ===========================================
359+
# These jobs use docker-container driver (default) for multi-arch builds.
360+
# They rebuild images because docker-container driver cannot access
361+
# locally built images from the test jobs.
362+
363+
# -------------------------------------------
364+
# Alpine Push: Base Images
365+
# -------------------------------------------
366+
push-alpine-base:
367+
needs: build-test-alpine
368+
if: github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-php'
369+
runs-on: ubuntu-latest
370+
371+
strategy:
372+
matrix:
373+
version: ["8.1", "8.2", "8.3", "8.4"]
374+
type: ["", "-prod"]
375+
376+
steps:
377+
- name: Checkout code
378+
uses: actions/checkout@v4
379+
380+
- name: Setup QEMU
381+
uses: docker/setup-qemu-action@v3
382+
383+
- name: Setup Docker Buildx
384+
uses: docker/setup-buildx-action@v3
385+
386+
- name: Login to Docker Hub
387+
uses: docker/login-action@v3
388+
with:
389+
username: ${{ secrets.DOCKER_USERNAME }}
390+
password: ${{ secrets.DOCKER_PASSWORD }}
391+
392+
- name: Push base image
393+
uses: docker/build-push-action@v6
394+
with:
395+
context: ${{ matrix.version }}${{ matrix.type }}
396+
push: true
397+
platforms: linux/amd64,linux/arm64
398+
tags: kooldev/php:${{ matrix.version }}${{ matrix.type }}
399+
400+
# -------------------------------------------
401+
# Alpine Push: Nginx Images (depends on base)
402+
# -------------------------------------------
403+
push-alpine-nginx:
404+
needs: push-alpine-base
405+
if: github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-php'
406+
runs-on: ubuntu-latest
407+
408+
strategy:
409+
matrix:
410+
version: ["8.1", "8.2", "8.3", "8.4"]
411+
type: ["", "-prod"]
412+
413+
steps:
414+
- name: Checkout code
415+
uses: actions/checkout@v4
416+
417+
- name: Setup QEMU
418+
uses: docker/setup-qemu-action@v3
419+
420+
- name: Setup Docker Buildx
421+
uses: docker/setup-buildx-action@v3
422+
423+
- name: Login to Docker Hub
424+
uses: docker/login-action@v3
425+
with:
426+
username: ${{ secrets.DOCKER_USERNAME }}
427+
password: ${{ secrets.DOCKER_PASSWORD }}
428+
429+
- name: Push nginx image
430+
uses: docker/build-push-action@v6
431+
with:
432+
context: ${{ matrix.version }}-nginx${{ matrix.type }}
433+
push: true
434+
platforms: linux/amd64,linux/arm64
435+
tags: kooldev/php:${{ matrix.version }}-nginx${{ matrix.type }}
436+
437+
# -------------------------------------------
438+
# Alpine Push: Node Images (depends on base)
439+
# -------------------------------------------
440+
push-alpine-node:
441+
needs: push-alpine-base
442+
if: github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-php'
443+
runs-on: ubuntu-latest
444+
445+
strategy:
446+
matrix:
447+
version: ["8.1", "8.2", "8.3", "8.4"]
448+
449+
steps:
450+
- name: Checkout code
451+
uses: actions/checkout@v4
452+
453+
- name: Setup QEMU
454+
uses: docker/setup-qemu-action@v3
455+
456+
- name: Setup Docker Buildx
457+
uses: docker/setup-buildx-action@v3
458+
459+
- name: Login to Docker Hub
460+
uses: docker/login-action@v3
461+
with:
462+
username: ${{ secrets.DOCKER_USERNAME }}
463+
password: ${{ secrets.DOCKER_PASSWORD }}
464+
465+
- name: Push node image
466+
uses: docker/build-push-action@v6
467+
with:
468+
context: ${{ matrix.version }}-node
469+
push: true
470+
platforms: linux/amd64,linux/arm64
471+
tags: kooldev/php:${{ matrix.version }}-node
472+
473+
# -------------------------------------------
474+
# Debian Push: Base Images
475+
# -------------------------------------------
476+
push-debian-base:
477+
needs: build-test-debian
478+
if: github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-php'
479+
runs-on: ubuntu-latest
480+
481+
strategy:
482+
matrix:
483+
type: ["", "-prod"]
484+
485+
steps:
486+
- name: Checkout code
487+
uses: actions/checkout@v4
488+
489+
- name: Setup QEMU
490+
uses: docker/setup-qemu-action@v3
491+
492+
- name: Setup Docker Buildx
493+
uses: docker/setup-buildx-action@v3
494+
495+
- name: Login to Docker Hub
496+
uses: docker/login-action@v3
497+
with:
498+
username: ${{ secrets.DOCKER_USERNAME }}
499+
password: ${{ secrets.DOCKER_PASSWORD }}
500+
501+
- name: Push base image (Debian)
502+
uses: docker/build-push-action@v6
503+
with:
504+
context: 8.4-debian${{ matrix.type }}
505+
push: true
506+
platforms: linux/amd64,linux/arm64
507+
tags: kooldev/php:8.4-debian${{ matrix.type }}
508+
509+
# -------------------------------------------
510+
# Debian Push: Nginx Images (depends on base)
511+
# -------------------------------------------
512+
push-debian-nginx:
513+
needs: push-debian-base
514+
if: github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-php'
515+
runs-on: ubuntu-latest
516+
517+
strategy:
518+
matrix:
519+
type: ["", "-prod"]
520+
521+
steps:
522+
- name: Checkout code
523+
uses: actions/checkout@v4
524+
525+
- name: Setup QEMU
526+
uses: docker/setup-qemu-action@v3
527+
528+
- name: Setup Docker Buildx
529+
uses: docker/setup-buildx-action@v3
530+
531+
- name: Login to Docker Hub
532+
uses: docker/login-action@v3
533+
with:
534+
username: ${{ secrets.DOCKER_USERNAME }}
535+
password: ${{ secrets.DOCKER_PASSWORD }}
536+
537+
- name: Push nginx image (Debian)
538+
uses: docker/build-push-action@v6
539+
with:
540+
context: 8.4-debian-nginx${{ matrix.type }}
541+
push: true
542+
platforms: linux/amd64,linux/arm64
543+
tags: kooldev/php:8.4-debian-nginx${{ matrix.type }}

0 commit comments

Comments
 (0)