-
-
Notifications
You must be signed in to change notification settings - Fork 41
70 lines (64 loc) · 1.75 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: ci
on:
pull_request:
push:
branches:
- master
env:
IMAGE_NAME: fizzka/docker-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 }}