Skip to content

Commit

Permalink
major updates (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
fizzka authored Nov 14, 2023
1 parent 89d21f5 commit b566376
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 321 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: ci

on:
pull_request:
push:
branches:
- master

env:
IMAGE_NAME: mileschou/phalcon
PHALCON_VERSION: 5.3.1

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 8
fail-fast: true
matrix:
php:
- 8.2
- 8.1
- "8.0"
- 7.4
variant:
- "" # cli
- -fpm
os:
- "" # debian-latest
- -alpine
env:
PHP_VARIANT: ${{ matrix.php }}${{ matrix.variant }}${{ matrix.os }}

steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/build-push-action@v5
with:
load: true
file: Dockerfile${{ matrix.os }}
build-args: |
PHP_VARIANT=${{ env.PHP_VARIANT }}
PHALCON_VERSION=${{ env.PHALCON_VERSION }}
tags: ${{ env.IMAGE_NAME }}:${{ env.PHP_VARIANT }}-tesing
-
name: Test
run: docker run --rm ${{ env.IMAGE_NAME }}:${{ env.PHP_VARIANT }}-tesing sh -c "php -v; php --ri phalcon | grep -i ^version"

-
name: Login
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v5
with:
push: true
file: Dockerfile${{ matrix.os }}
build-args: |
PHP_VARIANT=${{ env.PHP_VARIANT }}
PHALCON_VERSION=${{ env.PHALCON_VERSION }}
platforms: linux/amd64,linux/arm64
tags: ${{ env.IMAGE_NAME }}:${{ env.PHP_VARIANT }}
36 changes: 0 additions & 36 deletions .github/workflows/test_dockerfile.yml

This file was deleted.

28 changes: 0 additions & 28 deletions 7.4/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions 7.4/alpine/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions 7.4/apache/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions 7.4/fpm-alpine/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions 7.4/fpm/Dockerfile

This file was deleted.

23 changes: 0 additions & 23 deletions 8.0/Dockerfile

This file was deleted.

29 changes: 0 additions & 29 deletions 8.0/alpine/Dockerfile

This file was deleted.

16 changes: 8 additions & 8 deletions 8.1/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM php:8.1
ARG PHP_VARIANT=8.2

FROM php:${PHP_VARIANT}

LABEL maintainer="MilesChou <github.com/MilesChou>, fizzka <github.com/fizzka>"

Expand All @@ -7,16 +9,14 @@ ARG PHALCON_VERSION=5.0.4
RUN set -xe && \
docker-php-source extract && \
# Install ext-phalcon
curl -LO https://github.com/phalcon/cphalcon/archive/v${PHALCON_VERSION}.tar.gz && \
tar xzf /v${PHALCON_VERSION}.tar.gz && \
cd /tmp && \
curl -LO https://github.com/phalcon/cphalcon/releases/download/v${PHALCON_VERSION}/phalcon-pecl.tgz && \
tar xzf phalcon-pecl.tgz && \
docker-php-ext-install -j $(getconf _NPROCESSORS_ONLN) \
/cphalcon-${PHALCON_VERSION}/build/phalcon \
/tmp/phalcon-${PHALCON_VERSION} \
&& \
# Remove all temp files
rm -r \
/v${PHALCON_VERSION}.tar.gz \
/cphalcon-${PHALCON_VERSION} \
&& \
rm -r /tmp/phalcon-* && \
docker-php-source delete && \
php -m

Expand Down
18 changes: 9 additions & 9 deletions 8.1/alpine/Dockerfile → Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM php:8.1-alpine
ARG PHP_VARIANT=8.2

LABEL maintainer="MilesChou <github.com/MilesChou>, fizzka <github.com/fizzka>"
FROM php:${PHP_VARIANT}

ARG PHALCON_VERSION=5.0.4

LABEL maintainer="MilesChou <github.com/MilesChou>, fizzka <github.com/fizzka>"

RUN set -xe && \
apk add --no-cache --virtual .build-deps \
autoconf \
Expand All @@ -12,16 +14,14 @@ RUN set -xe && \
&& \
docker-php-source extract && \
# Install ext-phalcon
curl -LO https://github.com/phalcon/cphalcon/archive/v${PHALCON_VERSION}.tar.gz && \
tar xzf /v${PHALCON_VERSION}.tar.gz && \
cd /tmp && \
curl -LO https://github.com/phalcon/cphalcon/releases/download/v${PHALCON_VERSION}/phalcon-pecl.tgz && \
tar xzf phalcon-pecl.tgz && \
docker-php-ext-install -j $(getconf _NPROCESSORS_ONLN) \
/cphalcon-${PHALCON_VERSION}/build/phalcon \
/tmp/phalcon-${PHALCON_VERSION} \
&& \
# Remove all temp files
rm -r \
/v${PHALCON_VERSION}.tar.gz \
/cphalcon-${PHALCON_VERSION} \
&& \
rm -r /tmp/phalcon-* && \
docker-php-source delete && \
apk del .build-deps && \
php -m
Expand Down
Loading

0 comments on commit b566376

Please sign in to comment.