-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (71 loc) · 2.23 KB
/
ci.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
71
72
73
74
75
76
77
78
79
name: Build and publish
on:
push:
branches:
- master
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
tag: [8.1-alpine, 7.1-alpine]
image: [carlosalgms/docker-php-fpm-nginx]
latest: [8.1-alpine]
include:
- tag: 8.1-alpine
buildArgs: ""
buildArgsXDebug: ""
- tag: 7.1-alpine
buildArgs: |
PHP_VER=7
EXTRA_REPO=3.7
VARIABLE_DEPS=php7-mcrypt
COMPOSER_VERSION=2.2.18
buildArgsXDebug: |
XDEBUG_PKG=php7-xdebug
env:
TAGGED_IMAGE: ${{ matrix.image }}:${{ matrix.tag }}
TAGS: ${{ matrix.tag == matrix.latest && format('{0}:latest,', matrix.image) || '' }}${{ matrix.image }}:${{ matrix.tag }}
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
id: docker_login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push ${{ matrix.tag }}
id: build_image
uses: docker/build-push-action@v3
with:
context: .
pull: true
push: true
platforms: linux/amd64,linux/arm64
# platforms: linux/amd64,linux/arm64,linux/arm/v7
cache-from: ${{ env.TAGGED_IMAGE }}
cache-to: type=inline
build-args: ${{ matrix.buildArgs }}
tags: ${{ env.TAGS }}
- name: Xdebug Build and push ${{ matrix.tag }}
id: build_xdebug
uses: docker/build-push-action@v3
with:
context: .
pull: true
push: true
platforms: linux/amd64,linux/arm64
# platforms: linux/amd64,linux/arm64,linux/arm/v7
cache-from: ${{ env.TAGGED_IMAGE }}-xdebug
cache-to: type=inline
build-args: |
FROM_IMAGE=${{ env.TAGGED_IMAGE }}
${{ matrix.buildArgsXDebug }}
tags: ${{ env.TAGGED_IMAGE }}-xdebug
file: Dockerfile.xdebug