Skip to content

Commit

Permalink
add QEMU/ARM build
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciojs committed Oct 25, 2023
1 parent 48f343c commit 80f751a
Showing 1 changed file with 34 additions and 16 deletions.
50 changes: 34 additions & 16 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,53 @@ jobs:
strategy:
matrix:
version: ['8.0', '8.1', '8.2']
type: ['-swoole', '-nginx-swoole-prod']

steps:
- name: Checkout code
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4.1.1

- name: Build
run: |
docker build --pull -t kooldev/php:${{ matrix.version }}-swoole ${{ matrix.version }}-swoole
docker build --pull -t kooldev/php:${{ matrix.version }}-nginx-swoole-prod ${{ matrix.version }}-nginx-swoole-prod
- name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Tests
run: |
docker run kooldev/php:${{ matrix.version }}-swoole php -r "extension_loaded('swoole') or die(1);"
docker run kooldev/php:${{ matrix.version }}-swoole node -v
docker run kooldev/php:${{ matrix.version }}-swoole yarn -v
docker run kooldev/php:${{ matrix.version }}-nginx-swoole-prod php -r "extension_loaded('swoole') or die(1);"
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v2.1.0
uses: docker/login-action@v3
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-swoole'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push to DockerHub
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-swoole'
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: ${{ matrix.version }}${{ matrix.type }}
load: true
tags: kooldev/php:${{ matrix.version }}${{ matrix.type }}

- name: Tests (dev)
if: matrix.type == '-swoole'
run: |
docker push kooldev/php:${{ matrix.version }}-nginx-swoole
docker push kooldev/php:${{ matrix.version }}-nginx-swoole-prod
docker run kooldev/php:${{ matrix.version }}${{ matrix.type }} php -r "extension_loaded('swoole') or die(1);"
docker run kooldev/php:${{ matrix.version }}${{ matrix.type }} node -v
docker run kooldev/php:${{ matrix.version }}${{ matrix.type }} yarn -v
- name: Tests (prod)
if: matrix.type == '-nginx-swoole-prod'
run: |
docker run kooldev/php:${{ matrix.version }}${{ matrix.type }} php -r "extension_loaded('swoole') or die(1);"
docker run kooldev/php:${{ matrix.version }}${{ matrix.type }} nginx -v
- name: Build and push
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-swoole'
with:
context: ${{ matrix.version }}${{ matrix.type }}
platforms: linux/amd64,linux/arm64
push: true
tags: kooldev/php:${{ matrix.version }}${{ matrix.type }}

trigger-build-oci8:
name: Trigger OCI8 Build
Expand Down

0 comments on commit 80f751a

Please sign in to comment.